From c9515afd0507c36c7f5580db638953ccf11ee4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Osztrogon=C3=A1c?= Date: Wed, 27 Oct 2021 13:02:33 +0200 Subject: [PATCH] Test262 runner shouldn't change newline characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 csaba.osztrogonac@h-lab.eu --- tools/runners/run-test-suite-test262.py | 2 +- tools/runners/test262-harness.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/runners/run-test-suite-test262.py b/tools/runners/run-test-suite-test262.py index dfb4feeb8e..f8436b97fa 100755 --- a/tools/runners/run-test-suite-test262.py +++ b/tools/runners/run-test-suite-test262.py @@ -81,7 +81,7 @@ def prepare_test262_test_suite(args): if os.path.isdir(os.path.join(args.test_dir, '.git')): return 0 - return_code = subprocess.call(['git', 'clone', '--no-checkout', + return_code = subprocess.call(['git', 'clone', '--no-checkout', '--config', 'core.autocrlf=false', 'https://github.com/tc39/test262.git', args.test_dir]) if return_code: print('Cloning test262 repository failed.') diff --git a/tools/runners/test262-harness.py b/tools/runners/test262-harness.py index 68f5bd6a1b..33350ed194 100755 --- a/tools/runners/test262-harness.py +++ b/tools/runners/test262-harness.py @@ -495,7 +495,7 @@ def __init__(self, suite, name, full_path, strict_mode, command_template, module self.name = name self.full_path = full_path self.strict_mode = strict_mode - with open(self.full_path) as file_desc: + with open(self.full_path, "rb") as file_desc: self.contents = file_desc.read() test_record = parse_test_record(self.contents, name) self.test = test_record["test"] @@ -645,7 +645,7 @@ def run_test_in(self, tmp): return TestResult(code, out, err, self) def run(self): - tmp = TempFile(suffix=".js", prefix="test262-", text=True) + tmp = TempFile(suffix=".js", prefix="test262-") try: result = self.run_test_in(tmp) finally: