tests/Makefile

Wed, 20 Mar 2024 23:31:41 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 20 Mar 2024 23:31:41 +0100
changeset 845
2615317311b7
parent 833
5c926801f052
child 846
71f4e0a13bb0
permissions
-rw-r--r--

add cx_tree_visitor()

753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 # Copyright 2023 Mike Becker. All rights reserved.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 # Redistribution and use in source and binary forms, with or without
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 # modification, are permitted provided that the following conditions are met:
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 # 1. Redistributions of source code must retain the above copyright
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 # notice, this list of conditions and the following disclaimer.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 # 2. Redistributions in binary form must reproduce the above copyright
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 # notice, this list of conditions and the following disclaimer in the
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 # documentation and/or other materials provided with the distribution.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 include ../config.mk
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25
814
5f9e07d3dd6c fix using warning options with compilers which do not support them - fixes #363
Mike Becker <universe@uap-core.de>
parents: 798
diff changeset
26 CFLAGS += -I../src
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
27
754
4bc7d966c9db add an uwproj based install target
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
28 TEST_DIR=$(build_dir)/tests
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29
782
74d777455e96 migrate allocator tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 781
diff changeset
30 SRC = util_allocator.c test_utils.c test_hash_key.c test_allocator.c \
816
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
31 test_compare.c test_string.c test_buffer.c test_list.c test_tree.c \
789
9b2f5661bebd begin migration of buffer tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 787
diff changeset
32 test_printf.c test_mempool.c test_hash_map.c ucxtest.c
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
33
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
34 OBJ_EXT=.o
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
35 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
37 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
38
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
39 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
773
bbf2f18b3818 fix missing LDFLAGS when linking ucxtest
Mike Becker <universe@uap-core.de>
parents: 770
diff changeset
40 $(CC) -o $@ $(LDFLAGS) $+
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
41
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
42 $(build_dir)/libucx_static.a:
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
43 test -f "$@"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45 $(TEST_DIR):
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
46 $(MKDIR) $@
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
47
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
48 FORCE:
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
49
782
74d777455e96 migrate allocator tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 781
diff changeset
50 $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \
74d777455e96 migrate allocator tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 781
diff changeset
51 ../src/cx/allocator.h ../src/cx/common.h
74d777455e96 migrate allocator tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 781
diff changeset
52 @echo "Compiling $<"
74d777455e96 migrate allocator tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 781
diff changeset
53 $(CC) -o $@ $(CFLAGS) -c $<
74d777455e96 migrate allocator tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 781
diff changeset
54
789
9b2f5661bebd begin migration of buffer tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 787
diff changeset
55 $(TEST_DIR)/test_buffer$(OBJ_EXT): test_buffer.c ../src/cx/test.h \
798
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
56 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
57 ../src/cx/buffer.h ../src/cx/allocator.h
789
9b2f5661bebd begin migration of buffer tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 787
diff changeset
58 @echo "Compiling $<"
9b2f5661bebd begin migration of buffer tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 787
diff changeset
59 $(CC) -o $@ $(CFLAGS) -c $<
9b2f5661bebd begin migration of buffer tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 787
diff changeset
60
787
d0f02310aa47 migrate compare tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 785
diff changeset
61 $(TEST_DIR)/test_compare$(OBJ_EXT): test_compare.c ../src/cx/test.h \
d0f02310aa47 migrate compare tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 785
diff changeset
62 ../src/cx/compare.h ../src/cx/common.h
d0f02310aa47 migrate compare tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 785
diff changeset
63 @echo "Compiling $<"
d0f02310aa47 migrate compare tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 785
diff changeset
64 $(CC) -o $@ $(CFLAGS) -c $<
d0f02310aa47 migrate compare tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 785
diff changeset
65
768
0e1cf2cd500e migrate hash_key tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 767
diff changeset
66 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
0e1cf2cd500e migrate hash_key tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 767
diff changeset
67 ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
0e1cf2cd500e migrate hash_key tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 767
diff changeset
68 ../src/cx/allocator.h
0e1cf2cd500e migrate hash_key tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 767
diff changeset
69 @echo "Compiling $<"
0e1cf2cd500e migrate hash_key tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 767
diff changeset
70 $(CC) -o $@ $(CFLAGS) -c $<
0e1cf2cd500e migrate hash_key tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 767
diff changeset
71
785
bb18daa62d5f migrate map tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 782
diff changeset
72 $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \
bb18daa62d5f migrate map tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 782
diff changeset
73 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
bb18daa62d5f migrate map tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 782
diff changeset
74 ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \
bb18daa62d5f migrate map tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 782
diff changeset
75 ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/string.h \
bb18daa62d5f migrate map tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 782
diff changeset
76 ../src/cx/hash_key.h
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
77 @echo "Compiling $<"
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
78 $(CC) -o $@ $(CFLAGS) -c $<
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
79
798
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
80 $(TEST_DIR)/test_list$(OBJ_EXT): test_list.c ../src/cx/test.h \
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
81 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
816
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
82 ../src/cx/compare.h ../src/cx/utils.h ../src/cx/array_list.h \
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
83 ../src/cx/list.h ../src/cx/collection.h ../src/cx/allocator.h \
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
84 ../src/cx/iterator.h ../src/cx/linked_list.h
798
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
85 @echo "Compiling $<"
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
86 $(CC) -o $@ $(CFLAGS) -c $<
7644da6e2d35 migrate low level linked list tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 789
diff changeset
87
781
a786b0a89b37 migrate mempool tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 780
diff changeset
88 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
a786b0a89b37 migrate mempool tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 780
diff changeset
89 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
a786b0a89b37 migrate mempool tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 780
diff changeset
90 ../src/cx/mempool.h ../src/cx/allocator.h
a786b0a89b37 migrate mempool tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 780
diff changeset
91 @echo "Compiling $<"
a786b0a89b37 migrate mempool tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 780
diff changeset
92 $(CC) -o $@ $(CFLAGS) -c $<
a786b0a89b37 migrate mempool tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 780
diff changeset
93
780
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
94 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
95 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
96 ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
97 ../src/cx/buffer.h
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
98 @echo "Compiling $<"
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
99 $(CC) -o $@ $(CFLAGS) -c $<
9965df621652 migrate printf tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 778
diff changeset
100
778
4a72bc4f09f4 fix missing dependencies for test_string.c
Mike Becker <universe@uap-core.de>
parents: 777
diff changeset
101 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
4a72bc4f09f4 fix missing dependencies for test_string.c
Mike Becker <universe@uap-core.de>
parents: 777
diff changeset
102 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
4a72bc4f09f4 fix missing dependencies for test_string.c
Mike Becker <universe@uap-core.de>
parents: 777
diff changeset
103 ../src/cx/string.h ../src/cx/allocator.h
777
e5b29e6f0615 migrate string tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 773
diff changeset
104 @echo "Compiling $<"
e5b29e6f0615 migrate string tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 773
diff changeset
105 $(CC) -o $@ $(CFLAGS) -c $<
e5b29e6f0615 migrate string tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 773
diff changeset
106
816
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
107 $(TEST_DIR)/test_tree$(OBJ_EXT): test_tree.c ../src/cx/tree.h \
833
5c926801f052 vastly simplify tree iterators and add test for creating them
Mike Becker <universe@uap-core.de>
parents: 816
diff changeset
108 ../src/cx/common.h ../src/cx/iterator.h ../src/cx/test.h
816
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
109 @echo "Compiling $<"
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
110 $(CC) -o $@ $(CFLAGS) -c $<
425234b05dff add first basic low level tree functions
Mike Becker <universe@uap-core.de>
parents: 814
diff changeset
111
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
112 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
113 ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
114 ../src/cx/allocator.h ../src/szmul.c
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
115 @echo "Compiling $<"
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
116 $(CC) -o $@ $(CFLAGS) -c $<
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
117
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
118 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
119 @echo "Compiling $<"
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
120 $(CC) -o $@ $(CFLAGS) -c $<
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
121
770
ed710122af44 migrates self-test for testing allocator - relates to #342
Mike Becker <universe@uap-core.de>
parents: 768
diff changeset
122 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
ed710122af44 migrates self-test for testing allocator - relates to #342
Mike Becker <universe@uap-core.de>
parents: 768
diff changeset
123 ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
ed710122af44 migrates self-test for testing allocator - relates to #342
Mike Becker <universe@uap-core.de>
parents: 768
diff changeset
124 @echo "Compiling $<"
ed710122af44 migrates self-test for testing allocator - relates to #342
Mike Becker <universe@uap-core.de>
parents: 768
diff changeset
125 $(CC) -o $@ $(CFLAGS) -c $<
ed710122af44 migrates self-test for testing allocator - relates to #342
Mike Becker <universe@uap-core.de>
parents: 768
diff changeset
126

mercurial