2009-09-08 04:48:40 +04:00
SELFTEST = $( LD_LIBPATH_OVERRIDE) PYTHON = $( PYTHON) \
2009-01-30 22:38:27 +03:00
$( PERL) $( selftestdir) /selftest.pl --prefix= ${ selftest_prefix } \
2007-10-22 03:05:31 +04:00
--builddir= $( builddir) --srcdir= $( srcdir) \
2008-09-18 21:51:03 +04:00
--exclude= $( srcdir) /selftest/skip --testlist= "./selftest/tests.sh|" \
2009-08-17 16:45:51 +04:00
$( TEST_OPTIONS)
# this strange code is to handle the fact that the bash pipefail option is
# 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
# as having failed
2009-09-08 04:48:40 +04:00
ST_RM = ( rm -f $( selftest_prefix) /st_done &&
2009-08-17 16:45:51 +04:00
ST_TOUCH = && touch $( selftest_prefix) /st_done )
ST_DONE_TEST = @test -f $( selftest_prefix) /st_done || { echo "SELFTEST FAILED" ; exit 1; }
2007-10-22 03:05:31 +04:00
2008-09-18 21:51:03 +04:00
SELFTEST_NOSLOW_OPTS = --exclude= $( srcdir) /selftest/slow
2008-10-22 06:09:17 +04:00
SELFTEST_QUICK_OPTS = $( SELFTEST_NOSLOW_OPTS) --quick --include= $( srcdir) /selftest/quick
2010-04-09 18:27:39 +04:00
FILTER_XFAIL = $( PYTHON) -u $( selftestdir) /filter-subunit --expected-failures= $( srcdir) /selftest/knownfail
SUBUNIT_FORMATTER ?= $( PYTHON) -u $( selftestdir) /format-subunit --prefix= ${ selftest_prefix } --immediate
2010-01-20 01:05:04 +03:00
FORMAT_TEST_OUTPUT = $( FILTER_XFAIL) | $( SUBUNIT_FORMATTER)
2009-06-03 20:19:01 +04:00
2009-06-05 18:10:12 +04:00
test-subunit :: everything
2009-11-16 18:53:51 +03:00
$( ST_RM) $( SELFTEST) --socket-wrapper $( TESTS) $( ST_TOUCH)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2008-05-29 20:19:19 +04:00
2010-03-01 18:24:29 +03:00
test-subunit-filtered :: everything
$( ST_RM) $( SELFTEST) --socket-wrapper $( TESTS) $( ST_TOUCH) | $( FILTER_XFAIL)
$( ST_DONE_TEST)
2008-05-29 20:19:19 +04:00
slowtest :: everything
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( DEFAULT_TEST_OPTIONS) $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2009-06-12 16:21:03 +04:00
i f e q ( $( RUN_FROM_BUILD_FARM ) , y e s )
test :: everything
2009-09-08 04:48:40 +04:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) $( DEFAULT_TEST_OPTIONS) $( TESTS) $( ST_TOUCH) | $( FILTER_XFAIL) --strip-passed-output
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2009-12-08 11:19:35 +03:00
test -f ${ selftest_prefix } /summary && cat ${ selftest_prefix } /summary
2009-06-12 16:21:03 +04:00
e l s e
2009-11-25 16:42:24 +03:00
test ::
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) $( DEFAULT_TEST_OPTIONS) $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2009-06-12 16:21:03 +04:00
e n d i f
2008-05-29 20:19:19 +04:00
2008-02-19 05:29:03 +03:00
kvmtest :: everything
2009-09-08 04:48:40 +04:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) $( DEFAULT_TEST_OPTIONS) \
2010-01-20 01:05:04 +03:00
--target= kvm --image= $( KVM_IMAGE) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2008-02-19 05:29:03 +03:00
2008-02-19 17:12:57 +03:00
kvmquicktest :: everything
2009-09-08 04:48:40 +04:00
$( ST_RM) $( SELFTEST) $( DEFAULT_TEST_OPTIONS) \
2010-01-20 01:05:04 +03:00
$( SELFTEST_QUICK_OPTS) --target= kvm --image= $( KVM_IMAGE) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2008-02-19 17:12:57 +03:00
2008-02-09 18:05:55 +03:00
testone :: everything
2009-09-08 04:48:40 +04:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) $( DEFAULT_TEST_OPTIONS) --one $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
test-swrap :: everything
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
test-swrap-pcap :: everything
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper-pcap $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
test-swrap-keep-pcap :: everything
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper-keep-pcap $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
test-noswrap :: everything
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
quicktest :: all
2010-01-20 01:05:04 +03:00
$( ST_RM) $( SELFTEST) $( SELFTEST_QUICK_OPTS) --socket-wrapper $( TESTS) $( ST_TOUCH) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2009-06-05 18:10:12 +04:00
quicktest-subunit :: all
2009-09-08 04:48:40 +04:00
$( ST_RM) $( SELFTEST) $( SELFTEST_QUICK_OPTS) --socket-wrapper $( TESTS) $( ST_TOUCH)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2009-06-05 18:10:12 +04:00
2008-02-09 18:05:55 +03:00
quicktestone :: all
2009-09-08 04:48:40 +04:00
$( ST_RM) $( SELFTEST) $( SELFTEST_QUICK_OPTS) --socket-wrapper --one $( TESTS) | $( FORMAT_TEST_OUTPUT)
2009-08-17 16:45:51 +04:00
$( ST_DONE_TEST)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
testenv :: everything
2009-09-08 04:48:40 +04:00
$( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
2007-10-22 03:05:31 +04:00
2008-10-06 18:00:10 +04:00
testenv-% :: everything
2009-09-08 04:48:40 +04:00
SELFTEST_TESTENV = $* $( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
2008-10-06 18:00:10 +04:00
2008-10-12 00:22:29 +04:00
test-% ::
$( MAKE) test TESTS = $*
2008-02-09 18:05:55 +03:00
valgrindtest :: valgrindtest -all
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
valgrindtest-quick :: all
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /valgrind_run $( LD_LIBPATH_OVERRIDE) " \
2007-10-22 03:05:31 +04:00
VALGRIND = " valgrind -q --num-callers=30 --log-file= ${ selftest_prefix } /valgrind.log " \
2010-01-20 01:05:04 +03:00
$( SELFTEST) $( SELFTEST_QUICK_OPTS) --socket-wrapper $( TESTS) | $( FORMAT_TEST_OUTPUT)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
valgrindtest-all :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /valgrind_run $( LD_LIBPATH_OVERRIDE) " \
2007-10-22 03:05:31 +04:00
VALGRIND = " valgrind -q --num-callers=30 --log-file= ${ selftest_prefix } /valgrind.log " \
2010-01-20 01:05:04 +03:00
$( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper $( TESTS) | $( FORMAT_TEST_OUTPUT)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
valgrindtest-env :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /valgrind_run $( LD_LIBPATH_OVERRIDE) " \
2007-10-22 03:05:31 +04:00
VALGRIND = " valgrind -q --num-callers=30 --log-file= ${ selftest_prefix } /valgrind.log " \
2009-09-08 04:48:40 +04:00
$( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
gdbtest :: gdbtest -all
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
gdbtest-quick :: all
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /gdb_run $( LD_LIBPATH_OVERRIDE) " \
2010-01-20 01:05:04 +03:00
$( SELFTEST) $( SELFTEST_QUICK_OPTS) --socket-wrapper $( TESTS) | $( FORMAT_TEST_OUTPUT)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
gdbtest-all :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /gdb_run $( LD_LIBPATH_OVERRIDE) " \
2010-01-20 01:05:04 +03:00
$( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper $( TESTS) | $( FORMAT_TEST_OUTPUT)
2007-10-22 03:05:31 +04:00
2008-02-09 18:05:55 +03:00
gdbtest-env :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /gdb_run $( LD_LIBPATH_OVERRIDE) " \
2009-09-08 04:48:40 +04:00
$( SELFTEST) $( SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
2008-10-28 14:20:59 +03:00