aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
Diffstat (limited to 'wscript')
-rw-r--r--wscript17
1 files changed, 11 insertions, 6 deletions
diff --git a/wscript b/wscript
index be5a8159..c7182d58 100644
--- a/wscript
+++ b/wscript
@@ -445,7 +445,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))
@@ -462,9 +463,10 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]):
report.write(earl_assertion(test, result, asserter))
if expected_return != 0:
- # Run lax parsing test for negative test (may still fail)
- check([command[0]] + ['-l'] + command[1:],
- expected=None, name=action + ' lax')
+ if '-l' not in options:
+ # Run lax parsing test for negative test (may still fail)
+ check([command[0]] + ['-l'] + command[1:],
+ expected=None, name=action + ' lax')
else:
# Run model test for positive test (must succeed)
model_out_path = action + '.model.out'
@@ -478,7 +480,7 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]):
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 validation_test_suite(tst, base_uri, testdir, isyntax, osyntax, options=''):
@@ -506,7 +508,8 @@ 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)
@@ -588,6 +591,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')
# Serd validation test suite
with open('validation_earl.ttl', 'w') as report: