aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-11-25 13:26:30 +0100
committerDavid Robillard <d@drobilla.net>2018-11-25 22:12:48 +0100
commit1b278995563e85446d2ab6bfc4a8e9d3ed77ce7a (patch)
tree6dc3b559a13d86b13032694f1226be7318422520 /wscript
parentb5865b7ab1c687f537951f9d0b10c47b475bc23d (diff)
downloadserd-1b278995563e85446d2ab6bfc4a8e9d3ed77ce7a.tar.gz
serd-1b278995563e85446d2ab6bfc4a8e9d3ed77ce7a.tar.bz2
serd-1b278995563e85446d2ab6bfc4a8e9d3ed77ce7a.zip
Test fast model serialisation
Diffstat (limited to 'wscript')
-rw-r--r--wscript23
1 files changed, 15 insertions, 8 deletions
diff --git a/wscript b/wscript
index 9e91dfdb..737b6873 100644
--- a/wscript
+++ b/wscript
@@ -422,6 +422,16 @@ def get_resources_with_type(model, rdf_class):
tests += [s]
return tests
+def option_combinations(options):
+ "Return an iterator that cycles through all combinations of the given options"
+ import itertools
+
+ thru_options = []
+ for n in range(len(options) + 1):
+ thru_options += list(itertools.combinations(options, n))
+
+ return itertools.cycle(thru_options)
+
def test_suite(ctx, base_uri, testdir, report, isyntax, osyntax, options=''):
import itertools
@@ -448,12 +458,8 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, osyntax, options=''):
if len(tests) == 0:
return
- thru_flags = ['-e', '-b', '-r http://example.org/']
- thru_options = []
- for n in range(len(thru_flags) + 1):
- thru_options += list(itertools.combinations(thru_flags, n))
- thru_options_iter = itertools.cycle(thru_options)
-
+ extra_options_iter = option_combinations(['-f'])
+ thru_options_iter = option_combinations(['-e', '-b', '-r http://example.org/'])
quiet = not Options.options.verbose_tests
tests_name = '%s.%s' % (testdir, test_class[test_class.find('#') + 1:])
with autowaf.begin_tests(ctx, APPNAME, tests_name):
@@ -463,8 +469,9 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, osyntax, options=''):
rel_action = os.path.join(os.path.relpath(srcdir), action)
abs_action = os.path.join(srcdir, action)
uri = base_uri + os.path.basename(action)
- command = 'serdi_static -a %s %s "%s" > %s' % (
- options, rel_action, uri, action + '.out')
+ command = 'serdi_static -a %s %s %s "%s" > %s' % (
+ options, ' '.join(next(extra_options_iter)),
+ rel_action, uri, action + '.out')
# Run strict test
result = run_test(command, expected_return, action, quiet=quiet)