From 522e99f0c6d3a579a887d54002b130c7f09fc284 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 24 Feb 2025 08:27:33 -0800 Subject: [PATCH] Mark test_rollup as @crossplatform. NFC Because rollup seems to produce line endings different to our expected compiler output this change also moves the line_endings check from the `run_js` method to the `build` method. --- test/common.py | 8 ++++---- test/test_other.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/common.py b/test/common.py index 9aabd3229b9ec..55e7f96e0ca08 100644 --- a/test/common.py +++ b/test/common.py @@ -1412,6 +1412,10 @@ def build(self, filename, libraries=None, includes=None, force_c=False, emcc_arg self.run_process(cmd, stderr=self.stderr_redirect if not DEBUG else None) self.assertExists(output) + if output_suffix in ('.js', '.mjs'): + # Make sure we produced correct line endings + self.assertEqual(line_endings.check_line_endings(output), 0) + return output def get_func(self, src, name): @@ -1528,10 +1532,6 @@ def run_js(self, filename, engine=None, args=None, if stderr != STDOUT: stderr.close() - # Make sure that we produced proper line endings to the .js file we are about to run. - if not filename.endswith('.wasm'): - self.assertEqual(line_endings.check_line_endings(filename), 0) - ret = read_file(stdout_file) if not interleaved_output: ret += read_file(stderr_file) diff --git a/test/test_other.py b/test/test_other.py index dadaefb3b326d..318af8bea965e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15678,6 +15678,7 @@ def test_late_module_api_assignment(self): expected = f"Aborted(Attempt to set `Module.{prop}` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js')" self.do_runf(test_file('hello_world.c'), expected, emcc_args=['--post-js=post.js', '-sWASM_ASYNC_COMPILATION=0'], assert_returncode=NON_ZERO) + @crossplatform def test_rollup(self): copytree(test_file('rollup_node'), '.') self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORT_ES6', '-sEXIT_RUNTIME', '-sENVIRONMENT=node', '-sMODULARIZE', '-o', 'hello.mjs'])