From 8e86488fb0b644f95925d97dc8f25774e60da4c5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Jan 2011 00:30:49 +0000 Subject: More extensive test coverage. git-svn-id: http://svn.drobilla.net/serd/trunk@19 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- wscript | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'wscript') 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) -- cgit v1.2.1