diff options
author | David Robillard <d@drobilla.net> | 2018-11-25 13:26:30 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-05 17:12:38 +0100 |
commit | a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b (patch) | |
tree | 7249bca6f08cc8c9d8e134b3d0dccd2ff47c88f1 | |
parent | 1460ce896e041a7b33382504a84d747f0f7bd65e (diff) | |
download | serd-a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b.tar.gz serd-a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b.tar.bz2 serd-a061646f3a87e9e3729b4ac1f4dee2a88d0c8f5b.zip |
Test fast model serialisation
-rw-r--r-- | wscript | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -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) |