aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-01-04 14:06:24 -0500
committerDavid Robillard <d@drobilla.net>2018-01-04 19:34:53 -0500
commit254db2b87025e06693e3f8b17e6c7a5363c2d416 (patch)
tree85efe6947ba428124f8febcd4f587b81eae48409
parent982e8327a07c5da2eda2798ac184779bf3f8d2c7 (diff)
downloadserd-254db2b87025e06693e3f8b17e6c7a5363c2d416.tar.gz
serd-254db2b87025e06693e3f8b17e6c7a5363c2d416.tar.bz2
serd-254db2b87025e06693e3f8b17e6c7a5363c2d416.zip
Fix file URI to path conversion in test suite on Windows
-rw-r--r--wscript13
1 files changed, 12 insertions, 1 deletions
diff --git a/wscript b/wscript
index ea6b7c51..75991078 100644
--- a/wscript
+++ b/wscript
@@ -291,6 +291,16 @@ def test_thru(ctx, base, path, check_filename, flags, isyntax, osyntax,
else:
Logs.pprint('RED', 'FAIL: error running %s' % command)
+def file_uri_to_path(uri):
+ try:
+ from urlparse import urlparse # Python 2
+ except:
+ from urllib.parse import urlparse # Python 3
+
+ path = urlparse(uri).path
+ drive = os.path.splitdrive(path[1:])[0]
+ return path if not drive else path[1:]
+
def test_suite(ctx, base_uri, testdir, report, isyntax, osyntax, options=''):
import itertools
@@ -355,7 +365,8 @@ def test_suite(ctx, base_uri, testdir, report, isyntax, osyntax, options=''):
result = run_test(command, expected_return, action)
if (mf + 'result') in model[test]:
# Check output against test suite
- check_path = model[test][mf + 'result'][0][len('file://'):]
+ check_uri = model[test][mf + 'result'][0]
+ check_path = file_uri_to_path(check_uri)
result = autowaf.run_test(
ctx, APPNAME,
lambda: check_output(action + '.out', check_path),