aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-02-04 18:31:12 +0100
committerDavid Robillard <d@drobilla.net>2018-02-04 18:31:12 +0100
commitde6805925ffa661f47489c378393623c2d3668fa (patch)
treef8bc8e80b523a2af4410881243b217e31f50dc18 /wscript
parent4d82ac1e09f787c24c28d64d3f09665c94bc27c2 (diff)
downloadserd-de6805925ffa661f47489c378393623c2d3668fa.tar.gz
serd-de6805925ffa661f47489c378393623c2d3668fa.tar.bz2
serd-de6805925ffa661f47489c378393623c2d3668fa.zip
Factor out Turtle-to-Turtle test pattern
Diffstat (limited to 'wscript')
-rw-r--r--wscript19
1 files changed, 13 insertions, 6 deletions
diff --git a/wscript b/wscript
index 51fdc9c0..85e6276b 100644
--- a/wscript
+++ b/wscript
@@ -416,13 +416,20 @@ def test(ctx):
autowaf.pre_test(ctx, APPNAME)
autowaf.run_test(ctx, APPNAME, 'serd_test', dirs=['.'])
- autowaf.run_test(ctx, APPNAME,
- 'serdi_static -q -o turtle "%s/tests/good/base.ttl" "base.ttl" > tests/good/base.ttl.out' % srcdir,
- 0, name='base')
+ def test_ttl(in_name, expected_name):
+ in_path = 'tests/good/%s.ttl' % in_name
+ autowaf.run_test(
+ ctx, APPNAME,
+ 'serdi_static -o turtle "%s/%s" "%s" > %s.out' % (srcdir, in_path, in_path, in_path),
+ 0, name=in_name)
+
+ autowaf.run_test(
+ ctx, APPNAME,
+ lambda: file_equals('%s.out' % in_path,
+ '%s/tests/good/%s.ttl' % (srcdir, expected_name)),
+ True, name=in_name + '-check')
- autowaf.run_test(ctx, APPNAME,
- lambda: file_equals('%s/tests/good/base.ttl' % srcdir, 'tests/good/base.ttl.out'),
- True, name='base-check')
+ test_ttl('base', 'base')
nul = os.devnull
autowaf.run_tests(ctx, APPNAME, [