aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-05 21:01:12 +0200
committerDavid Robillard <d@drobilla.net>2022-01-13 23:04:00 -0500
commitcbb04334e5f422ab28d12f7a4c8a60eda1c94a89 (patch)
tree2d0822f72fc7831c14d54c3f5dbfadbfb2361858 /test
parent7a0d649727b4b5a15a88a1270aa444d4ed8ce779 (diff)
downloadserd-cbb04334e5f422ab28d12f7a4c8a60eda1c94a89.tar.gz
serd-cbb04334e5f422ab28d12f7a4c8a60eda1c94a89.tar.bz2
serd-cbb04334e5f422ab28d12f7a4c8a60eda1c94a89.zip
Simplify writer style options
Diffstat (limited to 'test')
-rw-r--r--test/meson.build3
-rwxr-xr-xtest/run_test_suite.py34
2 files changed, 23 insertions, 14 deletions
diff --git a/test/meson.build b/test/meson.build
index 04c89731..8a76bbb6 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -205,9 +205,6 @@ if get_option('utils')
base_uri = w3c_base + syntax + 'Tests/'
args = ['--syntax', syntax, manifest, base_uri]
- if syntax == 'TriG'
- args += ['--', '-a']
- endif
test(syntax, run_test_suite,
args: script_args + args,
diff --git a/test/run_test_suite.py b/test/run_test_suite.py
index 3f637146..5f1d29c8 100755
--- a/test/run_test_suite.py
+++ b/test/run_test_suite.py
@@ -47,6 +47,13 @@ def log_error(message):
sys.stderr.write(message)
+def test_osyntax_options(osyntax):
+ if osyntax.lower() == "ntriples" or osyntax.lower() == "nquads":
+ return ["-a"]
+
+ return []
+
+
def test_thru(
base_uri,
path,
@@ -81,16 +88,21 @@ def test_thru(
]
)
- thru_cmd = command_prefix + [
- "-i",
- isyntax,
- "-o",
- osyntax,
- "-c",
- "foo",
- out_path,
- base_uri,
- ]
+ thru_cmd = (
+ command_prefix
+ + test_osyntax_options(osyntax)
+ + [
+ "-i",
+ isyntax,
+ "-o",
+ osyntax,
+ "-c",
+ "foo",
+ "-a",
+ out_path,
+ base_uri,
+ ]
+ )
with open(out_path, "wb") as out:
subprocess.run(out_cmd, check=True, stdout=out)
@@ -255,7 +267,7 @@ def test_suite(
test_name = os.path.basename(test_uri_path)
test_path = os.path.join(test_dir, test_name)
- command = command_prefix + ["-f", test_path, test_uri]
+ command = command_prefix + ["-a"] + [test_path, test_uri]
command_string = " ".join(shlex.quote(c) for c in command)
out_filename = os.path.join(out_test_dir, test_name + ".out")