From 32604d573a456c52ef104211a078d6e2ae7e1d9f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 5 Jul 2018 21:01:12 +0200 Subject: Simplify writer style options --- wscript | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 9a1dd31a..c2b3a226 100644 --- a/wscript +++ b/wscript @@ -298,6 +298,11 @@ def check_output(out_filename, check_filename, subst_from='', subst_to=''): return False +def test_osyntax_options(osyntax): + if osyntax.lower() == 'ntriples' or osyntax.lower() == 'nquads': + return ' -a' + return '' + def test_thru(ctx, base, path, check_filename, flags, isyntax, osyntax, options='', quiet=False): in_filename = os.path.join(ctx.path.abspath(), path) @@ -305,9 +310,9 @@ def test_thru(ctx, base, path, check_filename, flags, isyntax, osyntax, command = ('serdi_static %s %s -i %s -o %s -p foo "%s" "%s" | ' 'serdi_static %s -i %s -o %s -c foo - "%s" > %s') % ( - options, flags.ljust(5), + options + test_osyntax_options(isyntax), flags.ljust(5), isyntax, isyntax, in_filename, base, - options, isyntax, osyntax, base, out_filename) + options + test_osyntax_options(osyntax), isyntax, osyntax, base, out_filename) if autowaf.run_test(ctx, APPNAME, command, 0, name=' to ' + out_filename, quiet=quiet): autowaf.run_test( @@ -374,7 +379,7 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, osyntax, options=''): if len(tests) == 0: return - thru_flags = ['-e', '-f', '-b', '-r http://example.org/'] + 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)) @@ -389,7 +394,7 @@ 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 %s -f %s "%s" > %s' % ( + command = 'serdi_static -a %s %s "%s" > %s' % ( options, rel_action, uri, action + '.out') # Run strict test @@ -528,7 +533,7 @@ def test(ctx): test_suite(ctx, w3c_base + 'NQuadsTests/', 'NQuadsTests', report, 'NQuads', 'NQuads') test_suite(ctx, w3c_base + 'TriGTests/', - 'TriGTests', report, 'TriG', 'NQuads', '-a') + 'TriGTests', report, 'TriG', 'NQuads') autowaf.post_test(ctx, APPNAME) -- cgit v1.2.1