diff options
-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) |