aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-05 21:01:12 +0200
committerDavid Robillard <d@drobilla.net>2019-04-13 19:15:32 +0200
commit75af0505f94bb148cd7b4d9004dec824fa13e6c9 (patch)
treeb8b8c8c9c14b23461692dcf7d9a29d6474b63627 /wscript
parent81f46794f4f1cc2f2da3eab3fa98c399d01715ef (diff)
downloadserd-75af0505f94bb148cd7b4d9004dec824fa13e6c9.tar.gz
serd-75af0505f94bb148cd7b4d9004dec824fa13e6c9.tar.bz2
serd-75af0505f94bb148cd7b4d9004dec824fa13e6c9.zip
Simplify writer style options
Diffstat (limited to 'wscript')
-rw-r--r--wscript22
1 files changed, 17 insertions, 5 deletions
diff --git a/wscript b/wscript
index af81ebe4..38e5e00d 100644
--- a/wscript
+++ b/wscript
@@ -256,19 +256,31 @@ def earl_assertion(test, passed, asserter):
serdi = './serdi_static'
+def test_osyntax_options(osyntax):
+ if osyntax.lower() == 'ntriples' or osyntax.lower() == 'nquads':
+ return [['-a']]
+ return []
+
+def flatten_options(opts):
+ return [o for sublist in opts for o in sublist]
+
def test_thru(check, base, path, check_path, flags, isyntax, osyntax, opts=[]):
out_path = path + '.pass'
- out_cmd = [serdi] + opts + [f for sublist in flags for f in sublist] + [
+ opts += flatten_options(test_osyntax_options(osyntax))
+ flags = flatten_options(flags)
+ osyntax_opts = [f for sublist in test_osyntax_options(osyntax) for f in sublist]
+ out_cmd = [serdi] + opts + flags + [
'-i', isyntax,
'-o', isyntax,
'-p', 'foo',
check.tst.src_path(path), base]
thru_path = path + '.thru'
- thru_cmd = [serdi] + opts + [
+ thru_cmd = [serdi] + opts + osyntax_opts + [
'-i', isyntax,
'-o', osyntax,
'-c', 'foo',
+ '-a',
out_path,
base]
@@ -335,7 +347,7 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]):
asserter = 'http://drobilla.net/drobilla#me'
def run_tests(test_class, tests, expected_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))
@@ -349,7 +361,7 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]):
action = os.path.join('tests', testdir, os.path.basename(action_node))
rel_action = os.path.join(os.path.relpath(srcdir), action)
uri = base_uri + os.path.basename(action)
- command = [serdi] + options + ['-f', rel_action, uri]
+ command = [serdi, '-a'] + options + [rel_action, uri]
# Run strict test
if expected_return == 0:
@@ -474,7 +486,7 @@ def test(tst):
test_suite(tst, w3c_base + 'NQuadsTests/',
'NQuadsTests', report, 'NQuads')
test_suite(tst, w3c_base + 'TriGTests/',
- 'TriGTests', report, 'Trig', ['-a'])
+ 'TriGTests', report, 'Trig')
def posts(ctx):
path = str(ctx.path.abspath())