aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-11-25 13:26:30 +0100
committerDavid Robillard <d@drobilla.net>2019-01-05 17:12:38 +0100
commita061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b (patch)
tree7249bca6f08cc8c9d8e134b3d0dccd2ff47c88f1
parent1460ce896e041a7b33382504a84d747f0f7bd65e (diff)
downloadserd-a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b.tar.gz
serd-a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b.tar.bz2
serd-a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b.zip
Test fast model serialisation
-rw-r--r--wscript23
1 files changed, 15 insertions, 8 deletions
diff --git a/wscript b/wscript
index 6dfadcd5..8d62382e 100644
--- a/wscript
+++ b/wscript
@@ -426,6 +426,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
@@ -452,12 +462,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):
@@ -467,8 +473,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)