aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-21 22:58:53 +0000
committerDavid Robillard <d@drobilla.net>2011-01-21 22:58:53 +0000
commit187a60b1e0e80e44b5be52a7054585f0be35ca9f (patch)
tree5a9568f5c802d2796d82d13f294ecf391767731f /wscript
parentfbf024e07f80f547677f9d39e64dd4bdd4be99f3 (diff)
downloadserd-187a60b1e0e80e44b5be52a7054585f0be35ca9f.tar.gz
serd-187a60b1e0e80e44b5be52a7054585f0be35ca9f.tar.bz2
serd-187a60b1e0e80e44b5be52a7054585f0be35ca9f.zip
Full rount-trip test coverage for Turtle reading and writing.
Fix writing UTF-8 URIs. Improved test coverage. git-svn-id: http://svn.drobilla.net/serd/trunk@28 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'wscript')
-rw-r--r--wscript48
1 files changed, 33 insertions, 15 deletions
diff --git a/wscript b/wscript
index e8f18366..e76c88a6 100644
--- a/wscript
+++ b/wscript
@@ -125,14 +125,18 @@ def test(ctx):
autowaf.pre_test(ctx, APPNAME)
autowaf.run_tests(ctx, APPNAME,
- ['./serdi_static > /dev/null',
- './serdi_static ftp://example.org/unsupported.ttl > /dev/null'],
- 1, name='serdi-fail')
-
- autowaf.run_tests(ctx, APPNAME,
['./serdi_static file:../tests/manifest.ttl > /dev/null',
+ './serdi_static file://../tests/manifest.ttl > /dev/null',
'./serdi_static ../tests/UTF-8.ttl > /dev/null'],
- 0, name='serdi-succeed')
+ 0, name='serdi-cmd-good')
+
+ autowaf.run_tests(ctx, APPNAME,
+ ['./serdi_static > /dev/null',
+ './serdi_static ftp://example.org/unsupported.ttl > /dev/null',
+ './serdi_static -o > /dev/null',
+ './serdi_static -z > /dev/null',
+ './serdi_static -o illegal > /dev/null'],
+ 1, name='serdi-cmd-bad')
commands = []
for test in good_tests:
@@ -141,7 +145,7 @@ def test(ctx):
autowaf.run_tests(ctx, APPNAME, commands, 0, name='good')
- Logs.pprint('BOLD', '\nVerifying output')
+ Logs.pprint('BOLD', '\nVerifying turtle => ntriples')
for test in good_tests:
out_filename = test + '.out'
if not os.access(out_filename, os.F_OK):
@@ -149,7 +153,7 @@ def test(ctx):
elif filecmp.cmp('../' + test.replace('.ttl', '.out'),
test + '.out',
False) != 1:
- Logs.pprint('RED', 'FAIL: %s output is incorrect' % test)
+ Logs.pprint('RED', 'FAIL: %s is incorrect' % out_filename)
else:
Logs.pprint('GREEN', 'Pass: %s' % test)
@@ -159,12 +163,26 @@ def test(ctx):
autowaf.run_tests(ctx, APPNAME, commands, 1, name='bad')
-# commands = []
-# for test in good_tests:
-# out_filename = test + '.thru'
-# commands += [ './serdi_static -o turtle ../%s \'%s\' | ./serdi_static - \'%s\' > %s.out' % (test, base_uri, base_uri, test) ]
-#
-# autowaf.run_tests(ctx, APPNAME, commands, 0, name='turtle-write')
-#
+ commands = []
+ for test in good_tests:
+ base_uri = 'http://www.w3.org/2001/sw/DataAccess/df1/' + test
+ out_filename = test + '.thru'
+ commands += [
+ '%s -o turtle ../%s \'%s\' | %s - \'%s\' > %s.thru' % (
+ './serdi_static', test, base_uri,
+ './serdi_static', base_uri, test) ]
+
+ autowaf.run_tests(ctx, APPNAME, commands, 0, name='turtle-round-trip')
+ Logs.pprint('BOLD', '\nVerifying ntriples => turtle => ntriples')
+ for test in good_tests:
+ out_filename = test + '.thru'
+ if not os.access(out_filename, os.F_OK):
+ Logs.pprint('RED', 'FAIL: %s output is missing' % test)
+ elif filecmp.cmp('../' + test.replace('.ttl', '.out'),
+ test + '.thru',
+ False) != 1:
+ Logs.pprint('RED', 'FAIL: %s is incorrect' % out_filename)
+ else:
+ Logs.pprint('GREEN', 'Pass: %s' % test)
autowaf.post_test(ctx, APPNAME)