diff options
author | David Robillard <d@drobilla.net> | 2019-03-10 22:50:31 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | e56e7291095bc9ba2368054601297c2cc65cdf90 (patch) | |
tree | e52cb576759a4dbf1c58eaab37fbe8b2b7b52623 /wscript | |
parent | c5284b46fddd76a9c45f6dfe41ee541b04451ace (diff) | |
download | serd-e56e7291095bc9ba2368054601297c2cc65cdf90.tar.gz serd-e56e7291095bc9ba2368054601297c2cc65cdf90.tar.bz2 serd-e56e7291095bc9ba2368054601297c2cc65cdf90.zip |
Add support for writing terse collections
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -251,7 +251,8 @@ def build(bld): ('read_chunk_test', 'tests/read_chunk_test.c'), ('serd_test', 'tests/serd_test.c'), ('sink_test', 'tests/sink_test.c'), - ('statement_test', 'tests/statement_test.c')]: + ('statement_test', 'tests/statement_test.c'), + ('terse_write_test', 'tests/terse_write_test.c')]: bld(features = 'c cprogram', source = prog[1], use = 'libserd_profiled', @@ -535,7 +536,13 @@ def _file_lines_equal(patha, pathb, subst_from='', subst_to=''): return True -def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]): +def test_suite(ctx, + base_uri, + testdir, + report, + isyntax, + options=[], + output_syntax=None): srcdir = ctx.path.abspath() mf = 'http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#' @@ -548,7 +555,7 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]): def run_tests(test_class, tests, expected_return): thru_flags = [['-e'], ['-f'], ['-b'], ['-r', 'http://example.org/']] - osyntax = _test_output_syntax(test_class) + osyntax = output_syntax or _test_output_syntax(test_class) thru_options_iter = _option_combinations(thru_flags) tests_name = '%s.%s' % (testdir, test_class[test_class.find('#') + 1:]) with ctx.group(tests_name) as check: @@ -558,7 +565,9 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, options=[]): action = os.path.join('tests', testdir, basename) rel_action = os.path.join(os.path.relpath(srcdir), action) uri = base_uri + os.path.basename(action) - command = [serdi, '-a'] + options + [rel_action, uri] + command = ([serdi, '-a', '-o', osyntax] + + options + + [rel_action, uri]) # Run strict test if expected_return == 0: @@ -612,7 +621,7 @@ def test(tst): import tempfile # Create test output directories - for i in ['bad', 'good', 'lax', + for i in ['bad', 'good', 'lax', 'terse', 'TurtleTests', 'NTriplesTests', 'NQuadsTests', 'TriGTests']: try: test_dir = os.path.join('tests', i) @@ -636,6 +645,7 @@ def test(tst): check(['./serd_test']) check(['./sink_test']) check(['./statement_test']) + check(['./terse_write_test']) def test_syntax_io(check, in_name, check_name, lang): in_path = 'tests/good/%s' % in_name @@ -716,6 +726,8 @@ def test(tst): test_suite(tst, serd_base + 'bad/', 'bad', None, 'Turtle') test_suite(tst, serd_base + 'lax/', 'lax', None, 'Turtle', ['-l']) test_suite(tst, serd_base + 'lax/', 'lax', None, 'Turtle') + test_suite(tst, serd_base + 'terse/', 'terse', None, 'Turtle', ['-t'], + output_syntax='Turtle') # Standard test suites with open('earl.ttl', 'w') as report: |