Skip to content

Commit b981afb

Browse files
committed
[windows][test] Improve line-directive test for Windows.
The line directive test was using a command for one of the tests. The command was being built as a string, instead of relaying on Python multi-platform command building from arrays. Additionally the command itself was being escaped with single quotes, which in Windows mean nothing and were ending in the output of the command. The changes switches the string building for an array, and leaves the string building and escaping to Python. This should work in both macOS, Linux and Windows. This should fix the failing test in Azure.
1 parent eb9b241 commit b981afb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/line-directive

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#
1212
# ----------------------------------------------------------------------------
1313
from __future__ import print_function
14+
1415
import bisect
1516
import os
1617
import re
@@ -646,10 +647,9 @@ def run():
646647
... // End:
647648
... ''')
648649
>>> long_output.flush()
649-
>>> long_output_result = subprocess.check_output(sys.executable + ' ' +
650-
... __file__ + ' ' + long_output.name + ' -- ' + "echo '" +
651-
... long_output.name + ":112:27: error:'",
652-
... shell=True).rstrip()
650+
>>> long_output_result = subprocess.check_output([sys.executable,
651+
... __file__, long_output.name, '--',
652+
... 'echo', long_output.name + ':112:27: error:']).rstrip()
653653
>>> print(long_output_result)
654654
/public/core/Map.swift.gyb:117:27: error:
655655
>>> target1.close()

0 commit comments

Comments
 (0)