| 1 |
# |
| 2 |
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
| 3 |
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
| 4 |
# |
| 5 |
# Permission is hereby granted to use or copy this program |
| 6 |
# for any purpose, provided the above notices are retained on all copies. |
| 7 |
# Permission to modify the code and to distribute modified code is granted, |
| 8 |
# provided the above notices are retained, and a notice that the code was |
| 9 |
# modified is included with the above copyright notice. |
| 10 |
|
| 11 |
# Common libs to _LDADD for all tests. |
| 12 |
test_ldadd = $(top_builddir)/libgc.la $(EXTRA_TEST_LIBS) |
| 13 |
|
| 14 |
TESTS += gctest$(EXEEXT) |
| 15 |
check_PROGRAMS += gctest |
| 16 |
gctest_SOURCES = tests/test.c |
| 17 |
gctest_LDADD = $(test_ldadd) |
| 18 |
if THREADS |
| 19 |
gctest_LDADD += $(THREADDLLIBS) |
| 20 |
endif |
| 21 |
gctest_DEPENDENCIES = $(top_builddir)/libgc.la |
| 22 |
|
| 23 |
TESTS += leaktest$(EXEEXT) |
| 24 |
check_PROGRAMS += leaktest |
| 25 |
leaktest_SOURCES = tests/leak_test.c |
| 26 |
leaktest_LDADD = $(test_ldadd) |
| 27 |
|
| 28 |
TESTS += middletest$(EXEEXT) |
| 29 |
check_PROGRAMS += middletest |
| 30 |
middletest_SOURCES = tests/middle.c |
| 31 |
middletest_LDADD = $(test_ldadd) |
| 32 |
|
| 33 |
TESTS += smashtest$(EXEEXT) |
| 34 |
check_PROGRAMS += smashtest |
| 35 |
smashtest_SOURCES = tests/smash_test.c |
| 36 |
smashtest_LDADD = $(test_ldadd) |
| 37 |
|
| 38 |
TESTS += hugetest$(EXEEXT) |
| 39 |
check_PROGRAMS += hugetest |
| 40 |
hugetest_SOURCES = tests/huge_test.c |
| 41 |
hugetest_LDADD = $(test_ldadd) |
| 42 |
|
| 43 |
TESTS += realloc_test$(EXEEXT) |
| 44 |
check_PROGRAMS += realloc_test |
| 45 |
realloc_test_SOURCES = tests/realloc_test.c |
| 46 |
realloc_test_LDADD = $(test_ldadd) |
| 47 |
|
| 48 |
TESTS += staticrootstest$(EXEEXT) |
| 49 |
check_PROGRAMS += staticrootstest |
| 50 |
staticrootstest_SOURCES = tests/staticrootstest.c |
| 51 |
staticrootstest_CFLAGS = -DSTATICROOTSLIB2 |
| 52 |
staticrootstest_LDADD = $(test_ldadd) libstaticrootslib_test.la \ |
| 53 |
libstaticrootslib2_test.la |
| 54 |
check_LTLIBRARIES += libstaticrootslib_test.la libstaticrootslib2_test.la |
| 55 |
libstaticrootslib_test_la_SOURCES = tests/staticrootslib.c |
| 56 |
libstaticrootslib_test_la_LIBADD = $(test_ldadd) |
| 57 |
libstaticrootslib_test_la_LDFLAGS = -no-undefined -rpath /nowhere |
| 58 |
libstaticrootslib_test_la_DEPENDENCIES = $(top_builddir)/libgc.la |
| 59 |
libstaticrootslib2_test_la_SOURCES = tests/staticrootslib.c |
| 60 |
libstaticrootslib2_test_la_LIBADD = $(test_ldadd) |
| 61 |
libstaticrootslib2_test_la_CFLAGS = -DSTATICROOTSLIB2 |
| 62 |
libstaticrootslib2_test_la_LDFLAGS = -no-undefined -rpath /nowhere |
| 63 |
|
| 64 |
if KEEP_BACK_PTRS |
| 65 |
TESTS += tracetest$(EXEEXT) |
| 66 |
check_PROGRAMS += tracetest |
| 67 |
tracetest_SOURCES = tests/trace_test.c |
| 68 |
tracetest_LDADD = $(test_ldadd) |
| 69 |
endif |
| 70 |
|
| 71 |
if THREADS |
| 72 |
|
| 73 |
TESTS += test_atomic_ops$(EXEEXT) |
| 74 |
check_PROGRAMS += test_atomic_ops |
| 75 |
test_atomic_ops_SOURCES = tests/test_atomic_ops.c |
| 76 |
# Really should need only $(ATOMIC_OPS_LIBS) |
| 77 |
test_atomic_ops_LDADD = $(test_ldadd) $(THREADDLLIBS) |
| 78 |
|
| 79 |
TESTS += threadleaktest$(EXEEXT) |
| 80 |
check_PROGRAMS += threadleaktest |
| 81 |
threadleaktest_SOURCES = tests/thread_leak_test.c |
| 82 |
threadleaktest_LDADD = $(test_ldadd) $(THREADDLLIBS) |
| 83 |
|
| 84 |
TESTS += threadkey_test$(EXEEXT) |
| 85 |
check_PROGRAMS += threadkey_test |
| 86 |
threadkey_test_SOURCES = tests/threadkey_test.c |
| 87 |
threadkey_test_LDADD = $(test_ldadd) $(THREADDLLIBS) |
| 88 |
|
| 89 |
TESTS += subthreadcreate_test$(EXEEXT) |
| 90 |
check_PROGRAMS += subthreadcreate_test |
| 91 |
subthreadcreate_test_SOURCES = tests/subthread_create.c |
| 92 |
subthreadcreate_test_LDADD = $(test_ldadd) $(THREADDLLIBS) |
| 93 |
|
| 94 |
TESTS += initsecondarythread_test$(EXEEXT) |
| 95 |
check_PROGRAMS += initsecondarythread_test |
| 96 |
initsecondarythread_test_SOURCES = tests/initsecondarythread.c |
| 97 |
initsecondarythread_test_LDADD = $(test_ldadd) $(THREADDLLIBS) |
| 98 |
|
| 99 |
endif |
| 100 |
|
| 101 |
if CPLUSPLUS |
| 102 |
TESTS += test_cpp$(EXEEXT) |
| 103 |
check_PROGRAMS += test_cpp |
| 104 |
test_cpp_SOURCES = tests/test_cpp.cc |
| 105 |
if AVOID_CPP_LIB |
| 106 |
test_cpp_LDADD = gc_cpp.o $(test_ldadd) $(CXXLIBS) |
| 107 |
else |
| 108 |
test_cpp_LDADD = libgccpp.la $(test_ldadd) $(CXXLIBS) |
| 109 |
endif |
| 110 |
endif |
| 111 |
|
| 112 |
if ENABLE_DISCLAIM |
| 113 |
|
| 114 |
TESTS += disclaim_test$(EXEEXT) |
| 115 |
check_PROGRAMS += disclaim_test |
| 116 |
disclaim_test_SOURCES = tests/disclaim_test.c |
| 117 |
disclaim_test_LDADD = $(test_ldadd) |
| 118 |
if THREADS |
| 119 |
disclaim_test_LDADD += $(THREADDLLIBS) |
| 120 |
endif |
| 121 |
|
| 122 |
TESTS += disclaim_bench$(EXEEXT) |
| 123 |
check_PROGRAMS += disclaim_bench |
| 124 |
disclaim_bench_SOURCES = tests/disclaim_bench.c |
| 125 |
disclaim_bench_LDADD = $(test_ldadd) |
| 126 |
|
| 127 |
endif |
| 128 |
|
| 129 |
# Run the tests directly (without test-driver): |
| 130 |
.PHONY: check-without-test-driver |
| 131 |
check-without-test-driver: $(TESTS) |
| 132 |
./gctest$(EXEEXT) |
| 133 |
./hugetest$(EXEEXT) |
| 134 |
./leaktest$(EXEEXT) |
| 135 |
./middletest$(EXEEXT) |
| 136 |
./realloc_test$(EXEEXT) |
| 137 |
./smashtest$(EXEEXT) |
| 138 |
./staticrootstest$(EXEEXT) |
| 139 |
test ! -f disclaim_bench$(EXEEXT) || ./disclaim_bench$(EXEEXT) |
| 140 |
test ! -f disclaim_test$(EXEEXT) || ./disclaim_test$(EXEEXT) |
| 141 |
test ! -f initsecondarythread_test$(EXEEXT) \ |
| 142 |
|| ./initsecondarythread_test$(EXEEXT) |
| 143 |
test ! -f test_atomic_ops$(EXEEXT) || ./test_atomic_ops$(EXEEXT) |
| 144 |
test ! -f threadkey_test$(EXEEXT) || ./threadkey_test$(EXEEXT) |
| 145 |
test ! -f threadleaktest$(EXEEXT) || ./threadleaktest$(EXEEXT) |
| 146 |
test ! -f subthreadcreate_test$(EXEEXT) || ./subthreadcreate_test$(EXEEXT) |
| 147 |
test ! -f test_cpp$(EXEEXT) || ./test_cpp$(EXEEXT) |
| 148 |
test ! -f tracetest$(EXEEXT) || ./tracetest$(EXEEXT) |
| 149 |
./cordtest$(EXEEXT) |