summaryrefslogtreecommitdiff
path: root/selftest/wscript
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2016-08-31 14:56:25 +1200
committerDouglas Bagnall <dbagnall@samba.org>2016-08-31 07:09:26 +0200
commitdfac53cd40d8f44cebcf15d9aceba5b4a8106b2a (patch)
tree9a85cb3b0ae35670db34a63c366d3be050e276b6 /selftest/wscript
parente908873757171db5b65296c5c3cdefe7d0fb0c01 (diff)
downloadsamba-dfac53cd40d8f44cebcf15d9aceba5b4a8106b2a.tar.gz
selftest: add an option to specify the test list
This can be used to override the default test lists used by `make test` and `make perftest`. This tests can either be programmatically generated (as is done for the defaults -- see selftest/tests.py for an example), or from a static list. For the generated lists, append a pipe symbol: make test TEST_LIST='/bin/sh /tmp/tests.sh|' and omit the pipe for a static list: make test TEST_LIST='/tmp/tests.txt' There are likely other useful modes of operation -- see `perldoc open` for the wondrous details. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'selftest/wscript')
-rw-r--r--selftest/wscript9
1 files changed, 8 insertions, 1 deletions
diff --git a/selftest/wscript b/selftest/wscript
index 5fa0dac457e..243cceb036d 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -81,6 +81,11 @@ def set_options(opt):
action="store_true", help="Run testsuites in random order")
gr.add_option('--perf-test', dest='PERF_TEST', default=False,
action="store_true", help="run performance tests only")
+ gr.add_option('--test-list', dest='TEST_LIST', default='',
+ action="store_true",
+ help=("use tests listed here, not defaults "
+ "(--test-list='FOO|' will execute FOO; "
+ "--test-list='FOO' will read it)"))
def configure(conf):
conf.env.SELFTEST_PREFIX = Options.options.SELFTEST_PREFIX
@@ -198,7 +203,9 @@ def cmd_testonly(opt):
if not os.path.isdir(env.SELFTEST_PREFIX):
os.makedirs(env.SELFTEST_PREFIX, int('755', 8))
- if Options.options.PERF_TEST:
+ if Options.options.TEST_LIST:
+ env.TESTLISTS = '--testlist=%r' % Options.options.TEST_LIST
+ elif Options.options.PERF_TEST:
env.TESTLISTS = '--testlist="${PYTHON} ${srcdir}/selftest/perf_tests.py|" '
else:
env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/selftest/tests.py|" ' +