diff options
author | David Robillard <d@drobilla.net> | 2018-02-04 18:31:12 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-02-04 18:31:12 +0100 |
commit | de6805925ffa661f47489c378393623c2d3668fa (patch) | |
tree | f8bc8e80b523a2af4410881243b217e31f50dc18 | |
parent | 4d82ac1e09f787c24c28d64d3f09665c94bc27c2 (diff) | |
download | serd-de6805925ffa661f47489c378393623c2d3668fa.tar.gz serd-de6805925ffa661f47489c378393623c2d3668fa.tar.bz2 serd-de6805925ffa661f47489c378393623c2d3668fa.zip |
Factor out Turtle-to-Turtle test pattern
-rw-r--r-- | tests/good/base.ttl | 1 | ||||
-rw-r--r-- | wscript | 19 |
2 files changed, 14 insertions, 6 deletions
diff --git a/tests/good/base.ttl b/tests/good/base.ttl index 755c1d09..4c437937 100644 --- a/tests/good/base.ttl +++ b/tests/good/base.ttl @@ -1,2 +1,3 @@ <foo> a <Bar> . + @@ -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, [ |