Skip to content

Commit 3c742be

Browse files
authored
Test262 runner shouldn't change newline characters (#4805)
It fixes the following test on Windows: built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác [email protected]
1 parent a024eb2 commit 3c742be

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/runners/run-test-suite-test262.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def prepare_test262_test_suite(args):
8181
if os.path.isdir(os.path.join(args.test_dir, '.git')):
8282
return 0
8383

84-
return_code = subprocess.call(['git', 'clone', '--no-checkout',
84+
return_code = subprocess.call(['git', 'clone', '--no-checkout', '--config', 'core.autocrlf=false',
8585
'https://github.com/tc39/test262.git', args.test_dir])
8686
if return_code:
8787
print('Cloning test262 repository failed.')

tools/runners/test262-harness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def __init__(self, suite, name, full_path, strict_mode, command_template, module
495495
self.name = name
496496
self.full_path = full_path
497497
self.strict_mode = strict_mode
498-
with open(self.full_path) as file_desc:
498+
with open(self.full_path, "rb") as file_desc:
499499
self.contents = file_desc.read()
500500
test_record = parse_test_record(self.contents, name)
501501
self.test = test_record["test"]
@@ -645,7 +645,7 @@ def run_test_in(self, tmp):
645645
return TestResult(code, out, err, self)
646646

647647
def run(self):
648-
tmp = TempFile(suffix=".js", prefix="test262-", text=True)
648+
tmp = TempFile(suffix=".js", prefix="test262-")
649649
try:
650650
result = self.run_test_in(tmp)
651651
finally:

0 commit comments

Comments
 (0)