Skip to content

Commit eb09362

Browse files
authored
Fix test_es5_transpile failure on windows (#17055)
1 parent b2a0a83 commit eb09362

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ jobs:
440440
- pip-install:
441441
python: "$EMSDK_PYTHON"
442442
- run-tests:
443-
test_targets: "other.test_emcc_cflags other.test_stdin other.test_bad_triple core2.test_sse1 core2.test_ccall other.test_closure_externs other.test_binaryen_debug other.test_js_optimizer_parse_error other.test_output_to_nowhere other.test_emcc_dev_null other.test_cmake* other.test_system_include_paths other.test_emar_response_file core2.test_utf16 other.test_special_chars_in_arguments other.test_toolchain_profiler other.test_realpath_nodefs other.test_response_file_encoding other.test_libc_progname other.test_realpath other.test_embed_file_dup other.test_dot_a_all_contents_invalid"
443+
test_targets: "other.test_es5_transpile other.test_emcc_cflags other.test_stdin other.test_bad_triple core2.test_sse1 core2.test_ccall other.test_closure_externs other.test_binaryen_debug other.test_js_optimizer_parse_error other.test_output_to_nowhere other.test_emcc_dev_null other.test_cmake* other.test_system_include_paths other.test_emar_response_file core2.test_utf16 other.test_special_chars_in_arguments other.test_toolchain_profiler other.test_realpath_nodefs other.test_response_file_encoding other.test_libc_progname other.test_realpath other.test_embed_file_dup other.test_dot_a_all_contents_invalid"
444444
# Run a single websockify-based test to ensure it works on windows.
445445
- run-tests:
446446
test_targets: "sockets.test_nodejs_sockets_echo*"

tests/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,17 @@ def verify_es5(self, filename):
625625
# See: https://github.com/dollarshaveclub/es-check/pull/126/
626626
es_check_env = os.environ.copy()
627627
es_check_env['PATH'] = os.path.dirname(config.NODE_JS[0]) + os.pathsep + es_check_env['PATH']
628+
inputfile = os.path.abspath(filename)
629+
# For some reason es-check requires unix paths, even on windows
630+
if WINDOWS:
631+
inputfile = inputfile.replace('\\', '/')
628632
try:
629633
# es-check prints the details of the errors to stdout, but it also prints
630634
# stuff in the case there are no errors:
631635
# ES-Check: there were no ES version matching errors!
632636
# pipe stdout and stderr so that we can choose if/when to print this
633637
# output and avoid spamming stdout when tests are successful.
634-
shared.run_process(es_check + ['es5', os.path.abspath(filename)], stdout=PIPE, stderr=STDOUT, env=es_check_env)
638+
shared.run_process(es_check + ['es5', inputfile], stdout=PIPE, stderr=STDOUT, env=es_check_env)
635639
except subprocess.CalledProcessError as e:
636640
print(e.stdout)
637641
self.fail('es-check failed to verify ES5 output compliance')

0 commit comments

Comments
 (0)