aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-21 00:30:49 +0000
committerDavid Robillard <d@drobilla.net>2011-01-21 00:30:49 +0000
commit8e86488fb0b644f95925d97dc8f25774e60da4c5 (patch)
tree1283b1a55bf2d6ab079f474528a823a80c3ca3f7
parente5a61bb9834ca8de00016dbc6f32519ad9342962 (diff)
downloadserd-8e86488fb0b644f95925d97dc8f25774e60da4c5.tar.gz
serd-8e86488fb0b644f95925d97dc8f25774e60da4c5.tar.bz2
serd-8e86488fb0b644f95925d97dc8f25774e60da4c5.zip
More extensive test coverage.
git-svn-id: http://svn.drobilla.net/serd/trunk@19 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--tests/UTF-8.ttl (renamed from UTF-8.ttl)0
-rw-r--r--wscript37
2 files changed, 27 insertions, 10 deletions
diff --git a/UTF-8.ttl b/tests/UTF-8.ttl
index 4aa347e8..4aa347e8 100644
--- a/UTF-8.ttl
+++ b/tests/UTF-8.ttl
diff --git a/wscript b/wscript
index a21415c0..078b5500 100644
--- a/wscript
+++ b/wscript
@@ -116,36 +116,53 @@ def test(ctx):
for i in glob.glob('build/tests/*.*'):
os.remove(i)
+ good_tests = glob.glob('tests/test-*.ttl')
+ good_tests.sort()
+
+ bad_tests = glob.glob('tests/bad-*.ttl')
+ bad_tests.sort()
+
autowaf.pre_test(ctx, APPNAME)
commands = []
- good_tests = glob.glob('tests/test-*.ttl')
- good_tests.sort()
for test in good_tests:
base_uri = 'http://www.w3.org/2001/sw/DataAccess/df1/' + test
commands = commands + [ './serdi_static ../%s \'%s\' > %s.out' % (test, base_uri, test) ]
autowaf.run_tests(ctx, APPNAME, commands, 0, name='good')
- Logs.pprint('BOLD', '\nVerifying serd.good test output')
+ Logs.pprint('BOLD', '\nVerifying output')
for test in good_tests:
- out_filename = 'build/' + test + '.out'
+ out_filename = test + '.out'
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'),
- 'build/' + test + '.out',
+ elif filecmp.cmp('../' + test.replace('.ttl', '.out'),
+ test + '.out',
False) != 1:
Logs.pprint('RED', 'FAIL: %s output is incorrect' % test)
else:
- Logs.pprint('GREEN', 'PASS: %s output is correct' % test)
- print
+ Logs.pprint('GREEN', 'Pass: %s' % test)
commands = []
- bad_tests = glob.glob('tests/bad-*.ttl')
- bad_tests.sort()
for test in bad_tests:
commands = commands + [ './serdi_static ../%s \'http://www.w3.org/2001/sw/DataAccess/df1/%s\' > %s.out' % (test, test, test) ]
autowaf.run_tests(ctx, APPNAME, commands, 1, name='bad')
+ autowaf.run_tests(ctx, APPNAME,
+ ['./serdi_static > /dev/null'],
+ 1, name='serdi-no-args')
+
+ autowaf.run_tests(ctx, APPNAME,
+ ['./serdi_static file:../tests/manifest.ttl > /dev/null'],
+ 0, name='serdi-file-uri')
+
+ autowaf.run_tests(ctx, APPNAME,
+ ['./serdi_static ftp://example.org/unsupported.ttl > /dev/null'],
+ 1, name='serdi-bad-uri')
+
+ autowaf.run_tests(ctx, APPNAME,
+ ['./serdi_static ../tests/UTF-8.ttl > /dev/null'],
+ 0, name='utf8')
+
autowaf.post_test(ctx, APPNAME)