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-12-19 20:55:29 -0500
commit1f97eee7bdb806c3e4e349a1e1be756736493bce (patch)
treee0c1065ed91716efe28c652ec73d9458e6a96c16 /wscript
parent0ce97313470a7c23bbad098346844f2ceabc07c5 (diff)
downloadserd-1f97eee7bdb806c3e4e349a1e1be756736493bce.tar.gz
serd-1f97eee7bdb806c3e4e349a1e1be756736493bce.tar.bz2
serd-1f97eee7bdb806c3e4e349a1e1be756736493bce.zip
Simplify writer style options
Diffstat (limited to 'wscript')
-rw-r--r--wscript24
1 files changed, 18 insertions, 6 deletions
diff --git a/wscript b/wscript
index e2a4cbc3..a252dfac 100644
--- a/wscript
+++ b/wscript
@@ -265,19 +265,31 @@ def earl_assertion(test, passed, asserter):
serdi = './serdi_static'
-def test_thru(check, base, path, check_path, flags, isyntax, osyntax, opts=[]):
+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, options=[]):
out_path = path + '.pass'
- out_cmd = [serdi] + opts + [f for sublist in flags for f in sublist] + [
+ opts = options + 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]
@@ -350,7 +362,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))
@@ -364,7 +376,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:
@@ -513,4 +525,4 @@ 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')