tests/Makefile

Tue, 09 Jan 2024 00:01:03 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 09 Jan 2024 00:01:03 +0100
changeset 798
7644da6e2d35
parent 789
9b2f5661bebd
child 814
5f9e07d3dd6c
permissions
-rw-r--r--

migrate low level linked list tests - relates to #342

universe@753 1 # Copyright 2023 Mike Becker. All rights reserved.
universe@753 2 #
universe@753 3 # Redistribution and use in source and binary forms, with or without
universe@753 4 # modification, are permitted provided that the following conditions are met:
universe@753 5 #
universe@753 6 # 1. Redistributions of source code must retain the above copyright
universe@753 7 # notice, this list of conditions and the following disclaimer.
universe@753 8 #
universe@753 9 # 2. Redistributions in binary form must reproduce the above copyright
universe@753 10 # notice, this list of conditions and the following disclaimer in the
universe@753 11 # documentation and/or other materials provided with the distribution.
universe@753 12 #
universe@753 13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@753 14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@753 15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
universe@753 16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
universe@753 17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
universe@753 18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
universe@753 19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
universe@753 20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
universe@753 21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
universe@753 22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
universe@753 23
universe@753 24 include ../config.mk
universe@753 25
universe@777 26 CFLAGS += -I../src -Wno-clobbered
universe@766 27
universe@754 28 TEST_DIR=$(build_dir)/tests
universe@753 29
universe@782 30 SRC = util_allocator.c test_utils.c test_hash_key.c test_allocator.c \
universe@798 31 test_compare.c test_string.c test_buffer.c test_list.c \
universe@789 32 test_printf.c test_mempool.c test_hash_map.c ucxtest.c
universe@753 33
universe@766 34 OBJ_EXT=.o
universe@766 35 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
universe@766 36
universe@766 37 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
universe@766 38
universe@767 39 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
universe@773 40 $(CC) -o $@ $(LDFLAGS) $+
universe@766 41
universe@766 42 $(build_dir)/libucx_static.a:
universe@766 43 test -f "$@"
universe@753 44
universe@753 45 $(TEST_DIR):
universe@766 46 $(MKDIR) $@
universe@766 47
universe@766 48 FORCE:
universe@766 49
universe@782 50 $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \
universe@782 51 ../src/cx/allocator.h ../src/cx/common.h
universe@782 52 @echo "Compiling $<"
universe@782 53 $(CC) -o $@ $(CFLAGS) -c $<
universe@782 54
universe@789 55 $(TEST_DIR)/test_buffer$(OBJ_EXT): test_buffer.c ../src/cx/test.h \
universe@798 56 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@798 57 ../src/cx/buffer.h ../src/cx/allocator.h
universe@789 58 @echo "Compiling $<"
universe@789 59 $(CC) -o $@ $(CFLAGS) -c $<
universe@789 60
universe@787 61 $(TEST_DIR)/test_compare$(OBJ_EXT): test_compare.c ../src/cx/test.h \
universe@787 62 ../src/cx/compare.h ../src/cx/common.h
universe@787 63 @echo "Compiling $<"
universe@787 64 $(CC) -o $@ $(CFLAGS) -c $<
universe@787 65
universe@768 66 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
universe@768 67 ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
universe@768 68 ../src/cx/allocator.h
universe@768 69 @echo "Compiling $<"
universe@768 70 $(CC) -o $@ $(CFLAGS) -c $<
universe@768 71
universe@785 72 $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \
universe@785 73 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@785 74 ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \
universe@785 75 ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/string.h \
universe@785 76 ../src/cx/hash_key.h
universe@766 77 @echo "Compiling $<"
universe@766 78 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 79
universe@798 80 $(TEST_DIR)/test_list$(OBJ_EXT): test_list.c ../src/cx/test.h \
universe@798 81 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@798 82 ../src/cx/array_list.h ../src/cx/list.h ../src/cx/collection.h \
universe@798 83 ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/linked_list.h
universe@798 84 @echo "Compiling $<"
universe@798 85 $(CC) -o $@ $(CFLAGS) -c $<
universe@798 86
universe@781 87 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
universe@781 88 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@781 89 ../src/cx/mempool.h ../src/cx/allocator.h
universe@781 90 @echo "Compiling $<"
universe@781 91 $(CC) -o $@ $(CFLAGS) -c $<
universe@781 92
universe@780 93 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
universe@780 94 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@780 95 ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
universe@780 96 ../src/cx/buffer.h
universe@780 97 @echo "Compiling $<"
universe@780 98 $(CC) -o $@ $(CFLAGS) -c $<
universe@780 99
universe@778 100 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
universe@778 101 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@778 102 ../src/cx/string.h ../src/cx/allocator.h
universe@777 103 @echo "Compiling $<"
universe@777 104 $(CC) -o $@ $(CFLAGS) -c $<
universe@777 105
universe@767 106 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
universe@767 107 ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
universe@767 108 ../src/cx/allocator.h ../src/szmul.c
universe@766 109 @echo "Compiling $<"
universe@766 110 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 111
universe@767 112 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
universe@766 113 @echo "Compiling $<"
universe@766 114 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 115
universe@770 116 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
universe@770 117 ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
universe@770 118 @echo "Compiling $<"
universe@770 119 $(CC) -o $@ $(CFLAGS) -c $<
universe@770 120

mercurial