]>
Commit | Line | Data |
---|---|---|
5ba96b90 | 1 | # Makefile.am --- automake input file for systemtap testsuite |
814bc89d FCE |
2 | ## process this file with automake to produce Makefile.in |
3 | ||
f245e619 | 4 | AUTOMAKE_OPTIONS = dejagnu no-dist subdir-objects |
814bc89d | 5 | |
814bc89d | 6 | all-local: |
5ba96b90 | 7 | @echo Run \"make check\" or \"make installcheck\". |
44da61d7 | 8 | @if test -n "$(DEJAZILLA)"; then echo Test results will be sent to $(DEJAZILLA); fi |
814bc89d FCE |
9 | |
10 | clean-local: | |
f105e61a | 11 | -rm -f ./stap site.exp systemtap.sum systemtap.log |
82dc4f2e | 12 | -rm -f systemtap.temp* |
2285f446 | 13 | -rm -rf .systemtap* .cache_test* 2>/dev/null |
26b3faf9 FCE |
14 | -rm -f ./stap_*.ko |
15 | -rm -f flightrec* | |
16 | -rm -f *.so | |
17 | -rm -f uprobe_* | |
8093ef39 | 18 | -rm -rf artifacts |
814bc89d | 19 | |
50d0c992 | 20 | DEJAZILLA=@dejazilla@ |
2c279bc4 | 21 | TESTAPPS=@enable_testapps@ |
d5658775 | 22 | TOOL_OPTS= |
23361495 | 23 | |
82dc4f2e MC |
24 | # The SYSTEMTAP_TESTSUITE_RESUME environmental variable will turn on the |
25 | # "resume mode" of the systemtap testsuite if set to some non-zero value. In | |
26 | # this mode, tests, that have already been run, are not being re-executed, and | |
27 | # their existing test results are being reused and merged instead. This can be | |
28 | # useful e.g. when some of the tests causes kernel panic or stall. Using the | |
29 | # "resume mode", it is possible to reboot the testing box, and then re-run the | |
30 | # testsuite skipping already executed tests. In this case, the problematic | |
31 | # testcase is left in an "unfinished" state. See "make list-unfinished". In | |
32 | # case the testsuite was running in the parallel testing mode, more than one | |
33 | # test will be left unfinished of course. Unfinished tests need separate | |
34 | # investigation. The "resume mode" can be used with "make installcheck", or | |
35 | # "make installcheck-parallel" targets. | |
36 | SKIPTESTS=--ignore \'$(shell \ | |
37 | test -z $(SYSTEMTAP_TESTSUITE_RESUME) || \ | |
91ccd79d | 38 | grep -r 'Running.*testsuite.*exp\ ...' systemtap.log 2>/dev/null |\ |
82dc4f2e MC |
39 | grep -o '[^\/]*\.exp' |\ |
40 | sort -u |\ | |
41 | tr '\n' ' ' |\ | |
42 | sed 's/\ $$/\n/' \ | |
43 | )\' | |
44 | ||
50d0c992 | 45 | # automake's dejagnu library already runs check-DEJAGNU before check-local |
d06394ea FCE |
46 | # That's why we need to add "execrc" to $(RUNTEST) - to ensure that this |
47 | # subtarget gets run even if runtest per se exits with a failure. | |
50d0c992 | 48 | check-local: |
44da61d7 JU |
49 | if test `( expr "$(DEJAZILLA)" : '.*://.*' )` -ne 0; then \ |
50 | curl -F file=@systemtap.sum $(DEJAZILLA); \ | |
51 | elif test `( expr "$(DEJAZILLA)" : '.*@.*' )` -ne 0; then \ | |
52 | mail $(DEJAZILLA) < systemtap.sum; \ | |
53 | fi | |
50d0c992 FCE |
54 | |
55 | # but installcheck does not follow an implicit check-DEJAGNU, go figure | |
2285f446 | 56 | installcheck: site.exp |
82dc4f2e | 57 | -rm -rf artifacts |
63bc915c | 58 | -test -z $(SYSTEMTAP_TESTSUITE_RESUME) && $(MAKE) clean && $(MAKE) site.exp |
82dc4f2e MC |
59 | -mv systemtap.log systemtap.temp1.log 2>/dev/null |
60 | -mv systemtap.sum systemtap.temp1.sum 2>/dev/null | |
2567a525 | 61 | -rmmod uprobes 2>/dev/null |
82dc4f2e | 62 | -$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU RUNTESTFLAGS="$(RUNTESTFLAGS) $(SKIPTESTS) --tool_opts \'install $(TOOL_OPTS)\'" |
91ccd79d MC |
63 | if test -e systemtap.temp1.log -o -e systemtap.temp1.sum; then \ |
64 | mv systemtap.log systemtap.temp2.log; \ | |
65 | mv systemtap.sum systemtap.temp2.sum; \ | |
66 | $(SHELL) $(srcdir)/dg-extract-results.sh `find . -name 'systemtap.temp[1,2].sum' -print` > systemtap.sum; \ | |
67 | $(SHELL) $(srcdir)/dg-extract-results.sh -L `find . -name 'systemtap.temp[1,2].log' -print` > systemtap.log; \ | |
68 | rm -f systemtap.temp1.log systemtap.temp1.sum systemtap.temp2.log systemtap.temp2.sum; \ | |
69 | fi | |
e22ce4c0 | 70 | -sed -ne '/systemtap.Summary/,$$ p' < systemtap.sum |
44da61d7 JU |
71 | if test `( expr "$(DEJAZILLA)" : '.*://.*' )` -ne 0; then \ |
72 | curl -F file=@systemtap.sum $(DEJAZILLA); \ | |
73 | elif test `( expr "$(DEJAZILLA)" : '.*@.*' )` -ne 0; then \ | |
74 | mail $(DEJAZILLA) < systemtap.sum; \ | |
75 | fi | |
5ba96b90 | 76 | |
82dc4f2e | 77 | |
8093ef39 MC |
78 | # In the parallel mode, the dg-extract-results.sh generates common .sum and .log |
79 | # files for all the tests, plus separate logs per testcase are kept in the artifacts | |
80 | # directory. Serial tests (see below) log to artifacts/__serialtests. | |
81 | installcheck-parallel: site.exp | |
63bc915c | 82 | -test -z $(SYSTEMTAP_TESTSUITE_RESUME) && $(MAKE) clean && $(MAKE) site.exp |
8093ef39 | 83 | -rmmod uprobes 2>/dev/null |
8093ef39 | 84 | mkdir -p artifacts/__serialtests |
6a32afec | 85 | MAKEFLAGS= $(RUNTEST2) systemtap.base/environment_sanity.exp |
8093ef39 MC |
86 | -$(MAKE) -k do-installcheck-parallel; \ |
87 | result=$$?; \ | |
88 | $(SHELL) $(srcdir)/dg-extract-results.sh \ | |
89 | `find artifacts -name systemtap.sum -print` > systemtap.sum; \ | |
90 | $(SHELL) $(srcdir)/dg-extract-results.sh -L \ | |
5fb76b57 | 91 | `find artifacts -name systemtap.log -print` > systemtap.log; |
81756081 | 92 | -tail systemtap.sum |
8093ef39 MC |
93 | exit $$result |
94 | ||
95 | # TESTS exists for the user to pass on the command line to easily | |
96 | # say "Only run these tests." With check or installcheck it's not necessary, but | |
97 | # with installcheck-parallel there's no other way to (easily) specify a subset | |
98 | # of tests. To specify all tests in a subdirectory, use TESTS=systemtap.subdir/*.exp. | |
99 | # E.g., make check TESTS="gdb.server/*.exp gdb.threads/*.exp". | |
100 | expanded_tests := $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(TESTS)))) | |
101 | ||
102 | # Following are all tests we want to run within the installcheck-parallel target. | |
103 | # Those are either specified via the TESTS env var, or all the available tests. | |
104 | all_tests := $(or $(expanded_tests),$(shell cd $(srcdir) && find systemtap.* -name '*.exp' -print)) | |
105 | ||
106 | # Tests that need to run serially. This namely applies to systemtap.server tests. | |
107 | # They start a new systemtap server and only expect one local server to run. | |
108 | all_serial_tests := $(shell cd $(srcdir) && find systemtap.server -name '*.exp' -print) | |
109 | serial_tests := $(filter $(all_tests),$(all_serial_tests)) | |
110 | ||
111 | # There are a few tests known to be slow. We run them right from the beginning | |
112 | # to try to lessen the overall time taken by the test suite -- if one of these | |
113 | # tests happens to be run late, it will cause the overall time to increase. | |
114 | all_slow_tests = systemtap.examples/check.exp systemtap.pass1-4/buildok.exp \ | |
115 | systemtap.base/listing_mode.exp systemtap.syscall/nd_syscall.exp \ | |
116 | systemtap.unprivileged/unprivileged_myproc.exp systemtap.syscall/syscall.exp \ | |
117 | systemtap.base/sdt_misc.exp systemtap.pass1-4/parseok.exp \ | |
118 | systemtap.base/listing_mode_sanity.exp systemtap.pass1-4/parse-semok.exp \ | |
119 | systemtap.pass1-4/semok.exp systemtap.unprivileged/unprivileged_probes.exp \ | |
120 | systemtap.pass1-4/buildok-interactive.exp \ | |
121 | systemtap.onthefly/uprobes_onthefly.exp \ | |
122 | systemtap.onthefly/kprobes_onthefly.exp systemtap.base/sdt.exp \ | |
123 | systemtap.onthefly/hrtimer_onthefly.exp \ | |
124 | systemtap.onthefly/tracepoint_onthefly.exp systemtap.exelib/exelib.exp \ | |
125 | systemtap.pass1-4/semko.exp systemtap.pass1-4/parseko.exp \ | |
126 | systemtap.base/rlimit.exp systemtap.base/tracepoints.exp \ | |
127 | systemtap.base/systemtap-service.exp systemtap.maps/map_hash.exp \ | |
128 | systemtap.base/stmt_rel.exp systemtap.base/library.exp | |
129 | slow_tests = $(filter $(all_tests),$(all_slow_tests)) | |
130 | ||
131 | regular_tests := $(filter-out $(serial_tests) $(slow_tests) ,$(all_tests)) | |
132 | ||
133 | REGULAR_TEST_TARGETS := $(addprefix installcheck/,$(slow_tests) $(regular_tests)) | |
134 | ||
135 | do-installcheck-parallel: installcheck-serial-tests $(REGULAR_TEST_TARGETS) | |
136 | @: | |
137 | ||
138 | installcheck-serial-tests: site.exp | |
82dc4f2e MC |
139 | -mv artifacts/__serialtests/systemtap.log artifacts/__serialtests/systemtap.temp1.log 2>/dev/null |
140 | -mv artifacts/__serialtests/systemtap.sum artifacts/__serialtests/systemtap.temp1.sum 2>/dev/null | |
141 | test -z $(serial_tests) || MAKEFLAGS= $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU RUNTESTFLAGS="--outdir=artifacts/__serialtests $(serial_tests) $(RUNTESTFLAGS) $(SKIPTESTS) --tool_opts \'install $(TOOL_OPTS)\'" STAP_PARALLEL=yes | |
142 | mv artifacts/__serialtests/systemtap.log artifacts/__serialtests/systemtap.temp2.log | |
143 | mv artifacts/__serialtests/systemtap.sum artifacts/__serialtests/systemtap.temp2.sum | |
144 | $(SHELL) $(srcdir)/dg-extract-results.sh `find ./artifacts/__serialtests -name 'systemtap.*sum' -print` > artifacts/__serialtests/systemtap.sum | |
145 | $(SHELL) $(srcdir)/dg-extract-results.sh -L `find ./artifacts/__serialtests -name 'systemtap.*log' -print` > artifacts/__serialtests/systemtap.log | |
146 | rm -f artifacts/__serialtests/systemtap.temp* | |
147 | ||
8093ef39 MC |
148 | |
149 | installcheck/%.exp: site.exp | |
82dc4f2e MC |
150 | if test -e artifacts/$* ; then \ |
151 | echo "Using existing test result for $*.exp"; \ | |
152 | else \ | |
153 | mkdir -p artifacts/$* ; \ | |
154 | MAKEFLAGS= $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU RUNTESTFLAGS="--outdir=artifacts/$* $*.exp $(RUNTESTFLAGS) --tool_opts \'install $(TOOL_OPTS)\'" STAP_PARALLEL=yes; \ | |
155 | fi | |
156 | ||
157 | # In case a test caused kernel panic or stall, followed by the test box reboot | |
158 | # and testsuite re-run, it will stay unfinished. All other testcases that might | |
159 | # have been running in parallel with it, are left unfinished too. After the the | |
160 | # last testsuite re-run, after all the testcases have been executed, unfinished | |
161 | # testcases should be listed and investigated manually. The "make clean" target | |
162 | # cleans whole the table entirely. | |
163 | list-unfinished: | |
73e7d9e3 | 164 | @find . -type f -name systemtap.log | xargs awk '/Running.*testsuite.*exp .../ {tests[$$2]++} /testcase.*testsuite.*completed in.*seconds/ {tests[$$2]++} END {for (key in tests) if (tests[key] != 2) { print key }}' |
8093ef39 | 165 | |
4040e9ea | 166 | # $(srcdir)/These values point the test suite to the install tree, and |
5ba96b90 FCE |
167 | # are overridden by "make check" from full source/build tree |
168 | SYSTEMTAP_RUNTIME=$(DESTDIR)$(pkgdatadir)/runtime | |
169 | SYSTEMTAP_TAPSET=$(DESTDIR)$(pkgdatadir)/tapset | |
20d1c358 | 170 | LD_LIBRARY_PATH=$(DESTDIR)$(libdir)/systemtap:$(DESTDIR)$(libdir)/dyninst |
674427d3 | 171 | CRASH_LIBDIR=$(DESTDIR)$(libdir)/systemtap |
d5658775 | 172 | SYSTEMTAP_PATH=$(DESTDIR)$(bindir) |
5a967319 | 173 | SYSTEMTAP_SPATH=$(DESTDIR)$(sbindir) |
818ba2bc | 174 | SYSTEMTAP_INCLUDES=$(DESTDIR)$(includedir) |
5ba96b90 | 175 | |
e01cd0ba DS |
176 | # These values get passed down from the main configure. |
177 | PYTHON=@python@ | |
178 | PYEXECDIR=@pyexecdir@ | |
179 | PYTHON3=@python3@ | |
180 | PY3EXECDIR=@py3execdir@ | |
5c84a24f | 181 | SYSCONFDIR=@sysconfdir@ |
e01cd0ba | 182 | |
8093ef39 | 183 | RUNTESTDEFAULTFLAGS = --tool $$tool --tool_opts \'$(TOOL_OPTS)\' --srcdir $(shell readlink -f $(srcdir)) |
50d0c992 | 184 | EXPECT = expect |
5a967319 FCE |
185 | RUNTEST= env XDG_DATA_DIRS= SYSTEMTAP_SYNC=1 LANG=C SYSTEMTAP_TESTREMOTES=$(TESTREMOTES) SYSTEMTAP_TESTAPPS=$(TESTAPPS) SYSTEMTAP_RUNTIME=$(SYSTEMTAP_RUNTIME) SYSTEMTAP_TAPSET=$(SYSTEMTAP_TAPSET) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) CRASH_LIBDIR=$(CRASH_LIBDIR) PATH=$(SYSTEMTAP_PATH):$(SYSTEMTAP_SPATH):$$PATH SYSTEMTAP_PATH=$(SYSTEMTAP_PATH) SYSTEMTAP_SPATH=$(SYSTEMTAP_SPATH) SYSTEMTAP_INCLUDES=$(SYSTEMTAP_INCLUDES) PKGLIBDIR=$(pkglibexecdir) PYTHON=$(PYTHON) PYEXECDIR=$(PYEXECDIR) PYTHON3=$(PYTHON3) PY3EXECDIR=$(PY3EXECDIR) SYSCONFDIR=$(SYSCONFDIR) $(srcdir)/execrc runtest |
186 | RUNTEST2= env XDG_DATA_DIRS= SYSTEMTAP_SYNC=1 LANG=C SYSTEMTAP_TESTREMOTES=$(TESTREMOTES) SYSTEMTAP_TESTAPPS=$(TESTAPPS) SYSTEMTAP_RUNTIME=$(SYSTEMTAP_RUNTIME) SYSTEMTAP_TAPSET=$(SYSTEMTAP_TAPSET) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) CRASH_LIBDIR=$(CRASH_LIBDIR) PATH=$(SYSTEMTAP_PATH):$(SYSTEMTAP_SPATH):$$PATH SYSTEMTAP_PATH=$(SYSTEMTAP_PATH) SYSTEMTAP_SPATH=$(SYSTEMTAP_SPATH) SYSTEMTAP_INCLUDES=$(SYSTEMTAP_INCLUDES) PKGLIBDIR=$(pkglibexecdir) PYTHON=$(PYTHON) PYEXECDIR=$(PYEXECDIR) PYTHON3=$(PYTHON3) PY3EXECDIR=$(PY3EXECDIR) SYSCONFDIR=$(SYSCONFDIR) runtest |