tests/Makefile

Sat, 30 Dec 2023 14:11:20 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 30 Dec 2023 14:11:20 +0100
changeset 781
a786b0a89b37
parent 780
9965df621652
child 782
74d777455e96
permissions
-rw-r--r--

migrate mempool tests - relates to #342

     1 # Copyright 2023 Mike Becker. All rights reserved.
     2 #
     3 # Redistribution and use in source and binary forms, with or without
     4 # modification, are permitted provided that the following conditions are met:
     5 #
     6 # 1. Redistributions of source code must retain the above copyright
     7 # notice, this list of conditions and the following disclaimer.
     8 #
     9 # 2. Redistributions in binary form must reproduce the above copyright
    10 # notice, this list of conditions and the following disclaimer in the
    11 # documentation and/or other materials provided with the distribution.
    12 #
    13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24 include ../config.mk
    26 CFLAGS += -I../src -Wno-clobbered
    28 TEST_DIR=$(build_dir)/tests
    30 SRC = util_allocator.c test_utils.c test_hash_key.c test_string.c \
    31 	test_printf.c test_mempool.c ucxtest.c
    33 OBJ_EXT=.o
    34 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
    36 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
    38 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
    39 	$(CC) -o $@ $(LDFLAGS) $+
    41 $(build_dir)/libucx_static.a:
    42 	test -f "$@"
    44 $(TEST_DIR):
    45 	$(MKDIR) $@
    47 FORCE:
    49 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
    50  ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
    51  ../src/cx/allocator.h
    52 	@echo "Compiling $<"
    53 	$(CC) -o $@ $(CFLAGS) -c $<
    55 $(TEST_DIR)/test_map_generics$(OBJ_EXT): test_map_generics.c \
    56  test_map_generics.h ../src/cx/map.h ../src/cx/common.h \
    57  ../src/cx/collection.h ../src/cx/allocator.h ../src/cx/iterator.h \
    58  ../src/cx/string.h ../src/cx/hash_key.h ../src/cx/hash_map.h \
    59  ../src/cx/map.h
    60 	@echo "Compiling $<"
    61 	$(CC) -o $@ $(CFLAGS) -c $<
    63 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
    64  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    65  ../src/cx/mempool.h ../src/cx/allocator.h
    66 	@echo "Compiling $<"
    67 	$(CC) -o $@ $(CFLAGS) -c $<
    69 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
    70  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    71  ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
    72  ../src/cx/buffer.h
    73 	@echo "Compiling $<"
    74 	$(CC) -o $@ $(CFLAGS) -c $<
    76 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
    77  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    78  ../src/cx/string.h ../src/cx/allocator.h
    79 	@echo "Compiling $<"
    80 	$(CC) -o $@ $(CFLAGS) -c $<
    82 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
    83  ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
    84  ../src/cx/allocator.h ../src/szmul.c
    85 	@echo "Compiling $<"
    86 	$(CC) -o $@ $(CFLAGS) -c $<
    88 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
    89 	@echo "Compiling $<"
    90 	$(CC) -o $@ $(CFLAGS) -c $<
    92 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
    93  ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
    94 	@echo "Compiling $<"
    95 	$(CC) -o $@ $(CFLAGS) -c $<

mercurial