1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

s4:selftest Fix 'make testenv-gdb' and 'make valgrindtest' etc

The problem here was that tridge's changes to ensure that test results
were always propogated didn't merge well with the addition of extra
environment variables for the 'make valgrindtest' and similar
environments.  By splitting out the macro further, we keep the build
farm reporting accurate, but allow these other test modes to work.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2009-09-08 10:48:40 +10:00
parent 56a0f995b8
commit 374e5937cd

View File

@ -1,6 +1,6 @@
TEST_FORMAT = plain TEST_FORMAT = plain
SELFTEST = ( rm -f $(selftest_prefix)/st_done && $(LD_LIBPATH_OVERRIDE) PYTHON=$(PYTHON) \ SELFTEST = $(LD_LIBPATH_OVERRIDE) PYTHON=$(PYTHON) \
$(PERL) $(selftestdir)/selftest.pl --prefix=${selftest_prefix} \ $(PERL) $(selftestdir)/selftest.pl --prefix=${selftest_prefix} \
--builddir=$(builddir) --srcdir=$(srcdir) \ --builddir=$(builddir) --srcdir=$(srcdir) \
--exclude=$(srcdir)/selftest/skip --testlist="./selftest/tests.sh|" \ --exclude=$(srcdir)/selftest/skip --testlist="./selftest/tests.sh|" \
@ -9,6 +9,7 @@ SELFTEST = ( rm -f $(selftest_prefix)/st_done && $(LD_LIBPATH_OVERRIDE) PYTHON=$
# not portable. When we run selftest we use a pipeline, and the first element # not portable. When we run selftest we use a pipeline, and the first element
# of that pipeline might abort. We need to catch this and mark the test # of that pipeline might abort. We need to catch this and mark the test
# as having failed # as having failed
ST_RM = ( rm -f $(selftest_prefix)/st_done &&
ST_TOUCH = && touch $(selftest_prefix)/st_done ) ST_TOUCH = && touch $(selftest_prefix)/st_done )
ST_DONE_TEST = @test -f $(selftest_prefix)/st_done || { echo "SELFTEST FAILED"; exit 1; } ST_DONE_TEST = @test -f $(selftest_prefix)/st_done || { echo "SELFTEST FAILED"; exit 1; }
@ -27,62 +28,61 @@ slowtest:: everything
ifeq ($(RUN_FROM_BUILD_FARM),yes) ifeq ($(RUN_FROM_BUILD_FARM),yes)
test:: everything test:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) $(TESTS) $(ST_TOUCH) | $(FILTER_XFAIL) --strip-passed-output $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) $(TESTS) $(ST_TOUCH) | $(FILTER_XFAIL) --strip-passed-output
$(ST_DONE_TEST) $(ST_DONE_TEST)
else else
test:: everything test:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
endif endif
kvmtest:: everything kvmtest:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) \ $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) \
--target=kvm --image=$(KVM_IMAGE) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate --target=kvm --image=$(KVM_IMAGE) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
kvmquicktest:: everything kvmquicktest:: everything
$(SELFTEST) $(DEFAULT_TEST_OPTIONS) \ $(ST_RM) $(SELFTEST) $(DEFAULT_TEST_OPTIONS) \
$(SELFTEST_QUICK_OPTS) --target=kvm --image=$(KVM_IMAGE) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) | $(FORMAT_TEST_OUTPUT) --immediate $(SELFTEST_QUICK_OPTS) --target=kvm --image=$(KVM_IMAGE) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
testone:: everything testone:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --one $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --one $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT)
$(ST_DONE_TEST) $(ST_DONE_TEST)
test-swrap:: everything test-swrap:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
test-swrap-pcap:: everything test-swrap-pcap:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper-pcap $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper-pcap $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
test-swrap-keep-pcap:: everything test-swrap-keep-pcap:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper-keep-pcap $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper-keep-pcap $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
test-noswrap:: everything test-noswrap:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(ST_RM) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
quicktest:: all quicktest:: all
$(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(ST_RM) $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST) $(ST_DONE_TEST)
quicktest-subunit:: all quicktest-subunit:: all
$(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) $(ST_RM) $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH)
$(ST_DONE_TEST) $(ST_DONE_TEST)
quicktestone:: all quicktestone:: all
$(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper --one $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) $(ST_RM) $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper --one $(TESTS) | $(FORMAT_TEST_OUTPUT)
$(ST_DONE_TEST) $(ST_DONE_TEST)
testenv:: everything testenv:: everything
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv $(ST_TOUCH) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
testenv-%:: everything testenv-%:: everything
SELFTEST_TESTENV=$* $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv $(ST_TOUCH) SELFTEST_TESTENV=$* $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
$(ST_DONE_TEST)
test-%:: test-%::
$(MAKE) test TESTS=$* $(MAKE) test TESTS=$*
@ -92,35 +92,29 @@ valgrindtest:: valgrindtest-all
valgrindtest-quick:: all valgrindtest-quick:: all
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \ SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \ VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST)
valgrindtest-all:: everything valgrindtest-all:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \ SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \ VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper $(TESTS) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST)
valgrindtest-env:: everything valgrindtest-env:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \ SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \ VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv $(ST_TOUCH) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
$(ST_DONE_TEST)
gdbtest:: gdbtest-all gdbtest:: gdbtest-all
gdbtest-quick:: all gdbtest-quick:: all
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \ SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
$(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper $(TESTS) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST)
gdbtest-all:: everything gdbtest-all:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \ SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT) --immediate $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper $(TESTS) | $(FORMAT_TEST_OUTPUT) --immediate
$(ST_DONE_TEST)
gdbtest-env:: everything gdbtest-env:: everything
SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \ SAMBA_VALGRIND="xterm -n server -e $(selftestdir)/gdb_run $(LD_LIBPATH_OVERRIDE)" \
$(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv $(ST_TOUCH) $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
$(ST_DONE_TEST)