summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-15 17:46:09 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:48 +1000
commit5c0f9079c27537a974c6a64a29ac4c864853057e (patch)
tree71ed8ecdf9ec1919f3c6ef0d948317f673fdf25a /source4
parent844acb226086e55de9a2442396a4e002471295e8 (diff)
downloadsamba-5c0f9079c27537a974c6a64a29ac4c864853057e.tar.gz
samba-5c0f9079c27537a974c6a64a29ac4c864853057e.tar.bz2
samba-5c0f9079c27537a974c6a64a29ac4c864853057e.zip
build: waf test now works (at least for some tests)
Diffstat (limited to 'source4')
-rw-r--r--source4/selftest/wscript36
1 files changed, 25 insertions, 11 deletions
diff --git a/source4/selftest/wscript b/source4/selftest/wscript
index d271ce783c..06ccc565d2 100644
--- a/source4/selftest/wscript
+++ b/source4/selftest/wscript
@@ -1,22 +1,36 @@
# selftest main code.
-import Scripting, os
+import Scripting, os, Options, Utils, Environment, optparse
-########################################################################
-# main test entry point
-def cmd_test(opt):
- '''Run the full test suite'''
- print "Starting full test"
########################################################################
# main test entry point
-def cmd_quicktest(opt):
+def cmd_test(opt):
'''Run the quick test suite'''
print "Starting quick test"
- #Scripting.commands += ['build']
- SELFTEST = 'PYTHON=/usr/bin/python perl -W ../selftest/selftest.pl --prefix=./st --builddir=. --srcdir=. --exclude=./selftest/skip --testlist="./selftest/tests.sh|" --exclude=./selftest/slow --quick --include=./selftest/quick --socket-wrapper | perl -W ../selftest/filter-subunit.pl --expected-failures=./selftest/knownfail | /usr/bin/perl -W ../selftest/format-subunit.pl --prefix=./st --format=plain --immediate'
- ret = os.system(SELFTEST)
+ Scripting.commands += ['build']
+ env = Environment.Environment()
+
+ env.TESTS = Options.options.TESTS
+
+ env.OPTIONS = ''
+ if Options.options.QUICKTEST:
+ env.OPTIONS += '--exclude=./selftest/slow --quick --include=./selftest/quick'
+
+ SELFTEST = 'PYTHON=/usr/bin/python perl -W ../selftest/selftest.pl --prefix=./st --builddir=. --srcdir=. --exclude=./selftest/skip --testlist="./selftest/tests.sh|" ${OPTIONS} --socket-wrapper ${TESTS} | perl -W ../selftest/filter-subunit.pl --expected-failures=./selftest/knownfail | /usr/bin/perl -W ../selftest/format-subunit.pl --prefix=./st --format=plain --immediate'
+
+ cmd = Utils.subst_vars(SELFTEST, env)
+ print "test: running %s" % cmd
+ ret = os.system(cmd)
def set_options(opt):
opt.ADD_COMMAND('test', cmd_test)
- opt.ADD_COMMAND('quicktest', cmd_quicktest)
+
+ gr = opt.add_option_group('test options')
+
+ gr.add_option('--tests',
+ help=("wildcard pattern of tests to run"),
+ action="store", dest='TESTS', default='')
+ gr.add_option('--quick',
+ help=("enable only quick tests"),
+ action="store_true", dest='QUICKTEST', default=False)