aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-11-25 16:12:23 +0100
committerDavid Robillard <d@drobilla.net>2019-10-27 22:40:23 +0100
commitbbe5313c31386366175222cde3055b63848ebb4c (patch)
treeb5d92f8d7e0b889aadd3528c7e94a99e0a7faa89 /wscript
parent433f17a017c3471afe6b09cb74929d0ce76822c4 (diff)
downloadserd-bbe5313c31386366175222cde3055b63848ebb4c.tar.gz
serd-bbe5313c31386366175222cde3055b63848ebb4c.tar.bz2
serd-bbe5313c31386366175222cde3055b63848ebb4c.zip
Fix lax handling of string errors and add separate lax test suite
Diffstat (limited to 'wscript')
-rw-r--r--wscript14
1 files changed, 7 insertions, 7 deletions
diff --git a/wscript b/wscript
index c34caeab..aa9fe3b1 100644
--- a/wscript
+++ b/wscript
@@ -357,7 +357,8 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]):
expected=expected_return,
name=action)
- if result and ((mf + 'result') in model[test]):
+ if (result and expected_return == 0 and
+ ((mf + 'result') in model[test])):
# Check output against test suite
check_uri = model[test][mf + 'result'][0]
check_path = ctx.src_path(file_uri_to_path(check_uri))
@@ -373,21 +374,18 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]):
if report is not None:
report.write(earl_assertion(test, result, asserter))
- # Run lax test
- check([command[0]] + ['-l'] + command[1:],
- expected=None, name=action + ' lax')
-
ns_rdftest = 'http://www.w3.org/ns/rdftest#'
for test_class, instances in instances.items():
if test_class.startswith(ns_rdftest):
- expected = 1 if 'Negative' in test_class else 0
+ expected = 1 if '-l' not in options and 'Negative' in test_class else 0
run_tests(test_class, instances, expected)
def test(tst):
import tempfile
# Create test output directories
- for i in ['bad', 'good', 'TurtleTests', 'NTriplesTests', 'NQuadsTests', 'TriGTests']:
+ for i in ['bad', 'good', 'lax',
+ 'TurtleTests', 'NTriplesTests', 'NQuadsTests', 'TriGTests']:
try:
test_dir = os.path.join('tests', i)
os.makedirs(test_dir)
@@ -472,6 +470,8 @@ def test(tst):
serd_base = 'http://drobilla.net/sw/serd/tests/'
test_suite(tst, serd_base + 'good/', 'good', None, 'Turtle')
test_suite(tst, serd_base + 'bad/', 'bad', None, 'Turtle')
+ test_suite(tst, serd_base + 'lax/', 'lax', None, 'Turtle', ['-l'])
+ test_suite(tst, serd_base + 'lax/', 'lax', None, 'Turtle')
# Standard test suites
with open('earl.ttl', 'w') as report: