diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/find_exe.py | 2 | ||||
-rwxr-xr-x | test/run-tests.py | 12 | ||||
-rw-r--r-- | test/spec.js | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/test/find_exe.py b/test/find_exe.py index 18481266..3d79ade4 100644 --- a/test/find_exe.py +++ b/test/find_exe.py @@ -49,6 +49,8 @@ if IS_WINDOWS: def FindExeWithFallback(name, default_exe_list, override_exe=None): result = override_exe if result is not None: + if IS_WINDOWS and os.path.splitext(result)[1] != '.exe': + result += '.exe' if os.path.exists(result): return os.path.abspath(result) raise Error('%s executable not found.\nsearch path: %s\n' % (name, result)) diff --git a/test/run-tests.py b/test/run-tests.py index 1a013d6c..1ce5a51d 100755 --- a/test/run-tests.py +++ b/test/run-tests.py @@ -117,10 +117,10 @@ def Indent(s, spaces): def DiffLines(expected, actual): - expected_lines = expected.splitlines(1) - actual_lines = actual.splitlines(1) + expected_lines = [line for line in expected.splitlines() if line] + actual_lines = [line for line in actual.splitlines() if line] return list(difflib.unified_diff(expected_lines, actual_lines, - fromfile='expected', tofile='actual')) + fromfile='expected', tofile='actual', lineterm='')) def AppendBeforeExt(file_path, suffix): @@ -366,11 +366,13 @@ class TestInfo(object): msg = '' if self.expected_stderr != stderr: diff_lines = DiffLines(self.expected_stderr, stderr) - msg += 'STDERR MISMATCH:\n' + ''.join(diff_lines) + if len(diff_lines) > 0: + msg += 'STDERR MISMATCH:\n' + '\n'.join(diff_lines) + '\n' if self.expected_stdout != stdout: diff_lines = DiffLines(self.expected_stdout, stdout) - msg += 'STDOUT MISMATCH:\n' + ''.join(diff_lines) + if len(diff_lines) > 0: + msg += 'STDOUT MISMATCH:\n' + '\n'.join(diff_lines) + '\n' if msg: raise Error(msg) diff --git a/test/spec.js b/test/spec.js index 2b1f9b33..bc3df3dd 100644 --- a/test/spec.js +++ b/test/spec.js @@ -46,7 +46,7 @@ var quiet = false; run(arguments[0]); function run(inPath) { - var lastSlash = inPath.lastIndexOf('/'); + var lastSlash = Math.max(inPath.lastIndexOf('/'), inPath.lastIndexOf('\\')); var inDir = lastSlash == -1 ? '.' : inPath.slice(0, lastSlash); var data = read(inPath); var jsonData = JSON.parse(data); |