aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/meson.build51
-rwxr-xr-xtest/run_suite.py6
-rw-r--r--test/serd_test_util/__init__.py4
-rwxr-xr-xtest/test_empty.py2
-rwxr-xr-xtest/test_quiet.py4
-rwxr-xr-xtest/test_stdin.py4
-rwxr-xr-xtest/test_write_error.py2
7 files changed, 40 insertions, 33 deletions
diff --git a/test/meson.build b/test/meson.build
index 496296c1..2178ce1f 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -99,12 +99,12 @@ if get_option('lint')
test('pylint', pylint, args: pylint_args + pylint_scripts, suite: 'scripts')
endif
- # Check Turtle formatting with serdi
+ # Check Turtle formatting with serd-pipe
foreach ttl_file_path : ttl_metadata_file_paths
test(
ttl_file_path.underscorify(),
check_formatting_py,
- args: [files(ttl_file_path), serdi, '-o', 'turtle'],
+ args: [files(ttl_file_path), serd_pipe, '-o', 'turtle'],
suite: 'data',
)
endforeach
@@ -170,7 +170,7 @@ if wrapper != ''
endif
simple_command_tests = {
- 'serdi': {
+ 'pipe': {
'bad': [
['-c'],
['-fi'],
@@ -197,22 +197,22 @@ simple_command_tests = {
},
}
-if is_variable('serdi')
- script_args = common_script_args + ['--serdi', serdi]
+if is_variable('serd_pipe')
+ pipe_script_args = common_script_args + ['--tool', serd_pipe]
serd_ttl = files('../serd.ttl')[0]
bad_input_file = files('extra/bad/bad-base.ttl')
- test('serd_ttl', serdi, args: [serd_ttl], env: test_env, suite: 'data')
+ test('serd_ttl', serd_pipe, args: [serd_ttl], env: test_env, suite: 'data')
# Command line options
- cmd_suite = ['serdi', 'options']
+ cmd_suite = ['tools', 'pipe', 'options']
- foreach kind, cases : simple_command_tests['serdi']
+ foreach kind, cases : simple_command_tests['pipe']
foreach args : cases
test(
' '.join(args).substring(1).underscorify(),
- serdi,
+ serd_pipe,
args: args,
env: test_env,
should_fail: kind == 'bad',
@@ -221,19 +221,19 @@ if is_variable('serdi')
endforeach
endforeach
- test('none', serdi, env: test_env, should_fail: true, suite: cmd_suite)
+ test('none', serd_pipe, env: test_env, should_fail: true, suite: cmd_suite)
test(
'quiet',
files('test_quiet.py'),
- args: script_args + [bad_input_file],
+ args: pipe_script_args + [bad_input_file],
env: test_env,
suite: cmd_suite,
)
# Inputs
- input_suite = ['serdi', 'input']
+ input_suite = ['tools', 'pipe', 'input']
bad_input_tests = {
'string': ['-s', '<foo> a <Bar> .'],
@@ -244,7 +244,7 @@ if is_variable('serdi')
foreach name, args : bad_input_tests
test(
name,
- serdi,
+ serd_pipe,
args: args,
env: test_env,
should_fail: true,
@@ -255,7 +255,7 @@ if is_variable('serdi')
test(
'stdin',
files('test_stdin.py'),
- args: script_args,
+ args: pipe_script_args,
env: test_env,
suite: input_suite,
)
@@ -265,7 +265,7 @@ if is_variable('serdi')
test(
'empty',
files('test_empty.py'),
- args: script_args + [serd_ttl],
+ args: pipe_script_args + [serd_ttl],
env: test_env,
suite: 'output',
)
@@ -279,13 +279,20 @@ if is_variable('serdi')
}
foreach name, args : io_error_tests
- test(name, serdi, args: args, env: test_env, should_fail: true, suite: 'io')
+ test(
+ name,
+ serd_pipe,
+ args: args,
+ env: test_env,
+ should_fail: true,
+ suite: 'io',
+ )
endforeach
test(
'write_error',
files('test_write_error.py'),
- args: script_args + [serd_ttl],
+ args: pipe_script_args + [serd_ttl],
env: test_env,
suite: 'io',
)
@@ -293,7 +300,7 @@ if is_variable('serdi')
if host_machine.system() == 'linux'
test(
'unreadable',
- serdi,
+ serd_pipe,
args: ['/sys/bus/pci/rescan'],
env: test_env,
should_fail: true,
@@ -441,15 +448,15 @@ test_suites = {
],
}
-# Run every test suite with serdi
-if is_variable('serdi')
- script_args = common_script_args + ['--serdi', serdi]
+# Run every test suite with serd-pipe
+if is_variable('serd_pipe')
+ script_args = common_script_args + ['--tool', serd_pipe]
foreach name, args : test_suites
test(
name,
run_suite,
- args: script_args + args,
+ args: pipe_script_args + args,
env: test_env,
suite: ['suite'],
timeout: 240,
diff --git a/test/run_suite.py b/test/run_suite.py
index b44808b7..fdda0625 100755
--- a/test/run_suite.py
+++ b/test/run_suite.py
@@ -154,14 +154,14 @@ def main():
parser.add_argument("--lax", action="store_true", help="tolerate errors")
parser.add_argument("--report", help="path to write result report to")
parser.add_argument("--reverse", action="store_true", help="reverse test")
- parser.add_argument("--serdi", default="tools/serdi", help="path to serdi")
+ parser.add_argument("--tool", default="tools/serd-pipe", help="executable")
parser.add_argument("--wrapper", default="", help="executable wrapper")
parser.add_argument("manifest", help="test suite manifest.ttl file")
parser.add_argument("base_uri", help="base URI for tests")
- parser.add_argument("arg", nargs=argparse.REMAINDER, help="serdi argument")
+ parser.add_argument("arg", nargs=argparse.REMAINDER, help="tool argument")
args = parser.parse_args(sys.argv[1:])
- command = shlex.split(args.wrapper) + [args.serdi]
+ command = shlex.split(args.wrapper) + [args.tool]
with tempfile.TemporaryDirectory() as temp:
return run_suite(args, command, temp)
diff --git a/test/serd_test_util/__init__.py b/test/serd_test_util/__init__.py
index 4f426009..ac831054 100644
--- a/test/serd_test_util/__init__.py
+++ b/test/serd_test_util/__init__.py
@@ -57,7 +57,7 @@ def wrapper_args(description, with_input=False):
"""Return the command line arguments for a wrapped test."""
parser = argparse.ArgumentParser(description)
- parser.add_argument("--serdi", default="tools/serdi", help="executable")
+ parser.add_argument("--tool", default="tools/serd-pipe", help="executable")
parser.add_argument("--wrapper", default="", help="executable wrapper")
if with_input:
parser.add_argument("input", help="input file")
@@ -149,7 +149,7 @@ def earl_assertion(test, passed, asserter):
def load_rdf(filename, base_uri, command_prefix):
- """Load an RDF file as dictionaries via serdi (only supports URIs)."""
+ """Load an RDF file as dictionaries via serd-pipe (only supports URIs)."""
rdf_type = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
model = {}
diff --git a/test/test_empty.py b/test/test_empty.py
index 3cd5517b..0ee641d5 100755
--- a/test/test_empty.py
+++ b/test/test_empty.py
@@ -14,7 +14,7 @@ import tempfile
import serd_test_util as util
args = util.wrapper_args(__doc__, True)
-command = shlex.split(args.wrapper) + [args.serdi, "-o", "empty", args.input]
+command = shlex.split(args.wrapper) + [args.tool, "-o", "empty", args.input]
with tempfile.TemporaryFile() as out:
proc = subprocess.run(command, check=False, stdout=out)
diff --git a/test/test_quiet.py b/test/test_quiet.py
index 676284bb..a58779ea 100755
--- a/test/test_quiet.py
+++ b/test/test_quiet.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-# Copyright 2022 David Robillard <d@drobilla.net>
+# Copyright 2022-2023 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: ISC
"""Test quiet command-line option."""
@@ -11,7 +11,7 @@ import subprocess
import serd_test_util as util
args = util.wrapper_args(__doc__, True)
-command = shlex.split(args.wrapper) + [args.serdi, "-q", args.input]
+command = shlex.split(args.wrapper) + [args.tool, "-q", args.input]
proc = subprocess.run(
command, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
diff --git a/test/test_stdin.py b/test/test_stdin.py
index fb01f4ee..9975c547 100755
--- a/test/test_stdin.py
+++ b/test/test_stdin.py
@@ -3,14 +3,14 @@
# Copyright 2022-2023 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: ISC
-"""Test reading from stdin with serdi."""
+"""Test reading from stdin with serd-pipe."""
# pylint: disable=consider-using-f-string
import serd_test_util as util
args = util.wrapper_args(__doc__)
-command = [args.serdi, "-i", "ntriples", "-", "http://example.org"]
+command = [args.tool, "-i", "ntriples", "-", "http://example.org"]
DOC = "<{0}s> <{0}p> <{0}o> .".format("http://example.org/")
diff --git a/test/test_write_error.py b/test/test_write_error.py
index b62f981a..7d165a6a 100755
--- a/test/test_write_error.py
+++ b/test/test_write_error.py
@@ -13,7 +13,7 @@ import os
import serd_test_util as util
args = util.wrapper_args(__doc__, True)
-command = shlex.split(args.wrapper) + [args.serdi, args.input]
+command = shlex.split(args.wrapper) + [args.tool, args.input]
if os.path.exists("/dev/full"):
with open("/dev/full", "w", encoding="utf-8") as out: