Merge branch 'selftest' of git://git.samba.org/jelmer/samba
[kai/samba.git] / source4 / selftest / config.mk
index 0f949997dfbbe4ebeadf8da4dc3dad9629df9ab1..74c177d8e84dd36d3eb4c5ade14058f53284ddcc 100644 (file)
@@ -1,74 +1,87 @@
-SELFTEST = $(PERL) $(srcdir)/selftest/selftest.pl --prefix=${selftest_prefix} \
+TEST_FORMAT = plain
+
+SELFTEST = $(LD_LIBPATH_OVERRIDE) $(PERL) $(selftestdir)/selftest.pl --prefix=${selftest_prefix} \
     --builddir=$(builddir) --srcdir=$(srcdir) \
-    --expected-failures=$(srcdir)/samba4-knownfail \
-    --skip=$(srcdir)/samba4-skip \
+    --expected-failures=$(srcdir)/selftest/knownfail \
+       --format=$(TEST_FORMAT) \
+    --exclude=$(srcdir)/selftest/skip --testlist="./selftest/tests.sh|" \
     $(TEST_OPTIONS) 
 
-htmltest: everything
-       $(SELFTEST) $(DEFAULT_TEST_OPTIONS) --format=html $(TESTS)
+SELFTEST_NOSLOW_OPTS = --exclude=$(srcdir)/selftest/slow
+SELFTEST_QUICK_OPTS = $(SELFTEST_NOSLOW_OPTS) --quick 
 
-test: everything
+slowtest:: everything
        $(SELFTEST) $(DEFAULT_TEST_OPTIONS) --immediate $(TESTS)
 
-testone: everything
-       $(SELFTEST) $(DEFAULT_TEST_OPTIONS) --one $(TESTS)
+test:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --immediate \
+               $(TESTS)
 
-test-swrap: everything
-       $(SELFTEST) --socket-wrapper --immediate $(TESTS)
+kvmtest:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --immediate \
+               --target=kvm --image=$(KVM_IMAGE)
 
-test-swrap-pcap: everything
-       $(SELFTEST) --socket-wrapper-pcap --immediate $(TESTS)
+kvmquicktest:: everything
+       $(SELFTEST) $(DEFAULT_TEST_OPTIONS) --immediate \
+               $(SELFTEST_QUICK_OPTS) --target=kvm --image=$(KVM_IMAGE)
 
-test-swrap-keep-pcap: everything
-       $(SELFTEST) --socket-wrapper-keep-pcap --immediate $(TESTS)
+testone:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --one $(TESTS)
 
-test-noswrap: everything
-       $(SELFTEST) --immediate $(TESTS)
+test-swrap:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --immediate $(TESTS)
 
-quicktest: all
-       $(SELFTEST) --quick --socket-wrapper --immediate $(TESTS)
+test-swrap-pcap:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper-pcap --immediate $(TESTS)
 
-htmlquicktest: all
-       $(SELFTEST) --quick --socket-wrapper --format=html --immediate $(TESTS)
+test-swrap-keep-pcap:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper-keep-pcap --immediate $(TESTS)
 
-quicktestone: all
-       $(SELFTEST) --quick --socket-wrapper --one $(TESTS)
+test-noswrap:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --immediate $(TESTS)
 
-testenv: everything
-       $(SELFTEST) --socket-wrapper --testenv
+quicktest:: all
+       $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper --immediate $(TESTS)
 
-valgrindtest: valgrindtest-all
+quicktestone:: all
+       $(SELFTEST) $(SELFTEST_QUICK_OPTS) --socket-wrapper --one $(TESTS)
 
-valgrindtest-quick: all
-       SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
-       VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
-       $(SELFTEST) --quick --immediate --socket-wrapper $(TESTS)
+testenv:: everything
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
 
-valgrindtest-all: everything
-       SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
-       VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
-       $(SELFTEST) --immediate --socket-wrapper $(TESTS)
+testenv-%:: everything
+       SELFTEST_TESTENV=$* $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
 
-valgrindtest-env: everything
-       SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
-       VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
-       $(SELFTEST) --socket-wrapper --testenv
+test-%:: 
+       $(MAKE) test TESTS=$*
 
-gdbtest: gdbtest-all
+valgrindtest:: valgrindtest-all
 
-gdbtest-quick: all
-       SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
-       $(SELFTEST) --immediate --quick --socket-wrapper $(TESTS)
+valgrindtest-quick:: all
+       SMBD_VALGRIND="xterm -n server -e $(srcdir)/script/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
+       VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+       $(SELFTEST) $(SELFTEST_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
+
+valgrindtest-all:: everything
+       SMBD_VALGRIND="xterm -n server -e $(srcdir)/script/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
+       VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
 
-gdbtest-all: everything
-       SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
-       $(SELFTEST) --immediate --socket-wrapper $(TESTS)
+valgrindtest-env:: everything
+       SMBD_VALGRIND="xterm -n server -e $(srcdir)/script/valgrind_run $(LD_LIBPATH_OVERRIDE)" \
+       VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv
 
-gdbtest-env: everything
-       SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
-       $(SELFTEST) --socket-wrapper --testenv
+gdbtest:: gdbtest-all
 
-wintest: all
-       $(SELFTEST) win
+gdbtest-quick:: all
+       SMBD_VALGRIND="xterm -n server -e $(srcdir)/script/gdb_run $(LD_LIBPATH_OVERRIDE)" \
+       $(SELFTEST) $(SELFTEST_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
 
+gdbtest-all:: everything
+       SMBD_VALGRIND="xterm -n server -e $(srcdir)/script/gdb_run $(LD_LIBPATH_OVERRIDE)" \
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
 
+gdbtest-env:: everything
+       SMBD_VALGRIND="xterm -n server -e $(srcdir)/script/gdb_run $(LD_LIBPATH_OVERRIDE)" \
+       $(SELFTEST) $(SELFTEST_NOSLOW_OPTS) --socket-wrapper --testenv