tests/Makefile

Mon, 01 Jan 2024 16:42:37 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 01 Jan 2024 16:42:37 +0100
changeset 789
9b2f5661bebd
parent 787
d0f02310aa47
child 798
7644da6e2d35
permissions
-rw-r--r--

begin migration of buffer 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_allocator.c \
    31 	test_compare.c test_string.c test_buffer.c \
    32 	test_printf.c test_mempool.c test_hash_map.c ucxtest.c
    34 OBJ_EXT=.o
    35 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
    37 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
    39 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
    40 	$(CC) -o $@ $(LDFLAGS) $+
    42 $(build_dir)/libucx_static.a:
    43 	test -f "$@"
    45 $(TEST_DIR):
    46 	$(MKDIR) $@
    48 FORCE:
    50 $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \
    51  ../src/cx/allocator.h ../src/cx/common.h
    52 	@echo "Compiling $<"
    53 	$(CC) -o $@ $(CFLAGS) -c $<
    55 $(TEST_DIR)/test_buffer$(OBJ_EXT): test_buffer.c ../src/cx/test.h \
    56  ../src/cx/buffer.h ../src/cx/common.h ../src/cx/allocator.h
    57 	@echo "Compiling $<"
    58 	$(CC) -o $@ $(CFLAGS) -c $<
    60 $(TEST_DIR)/test_compare$(OBJ_EXT): test_compare.c ../src/cx/test.h \
    61  ../src/cx/compare.h ../src/cx/common.h
    62 	@echo "Compiling $<"
    63 	$(CC) -o $@ $(CFLAGS) -c $<
    65 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
    66  ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
    67  ../src/cx/allocator.h
    68 	@echo "Compiling $<"
    69 	$(CC) -o $@ $(CFLAGS) -c $<
    71 $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \
    72  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    73  ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \
    74  ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/string.h \
    75  ../src/cx/hash_key.h
    76 	@echo "Compiling $<"
    77 	$(CC) -o $@ $(CFLAGS) -c $<
    79 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
    80  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    81  ../src/cx/mempool.h ../src/cx/allocator.h
    82 	@echo "Compiling $<"
    83 	$(CC) -o $@ $(CFLAGS) -c $<
    85 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
    86  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    87  ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
    88  ../src/cx/buffer.h
    89 	@echo "Compiling $<"
    90 	$(CC) -o $@ $(CFLAGS) -c $<
    92 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
    93  util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
    94  ../src/cx/string.h ../src/cx/allocator.h
    95 	@echo "Compiling $<"
    96 	$(CC) -o $@ $(CFLAGS) -c $<
    98 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
    99  ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
   100  ../src/cx/allocator.h ../src/szmul.c
   101 	@echo "Compiling $<"
   102 	$(CC) -o $@ $(CFLAGS) -c $<
   104 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
   105 	@echo "Compiling $<"
   106 	$(CC) -o $@ $(CFLAGS) -c $<
   108 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
   109  ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
   110 	@echo "Compiling $<"
   111 	$(CC) -o $@ $(CFLAGS) -c $<

mercurial