diff --git a/emcc.py b/emcc.py index e4400f0ca220..a866541ccae1 100644 --- a/emcc.py +++ b/emcc.py @@ -4207,7 +4207,6 @@ def generate_traditional_runtime_html(target, options, js_target, target_basenam shell = do_replace(shell, '{{{ SCRIPT }}}', script.replacement()) shell = shell.replace('{{{ SHELL_CSS }}}', utils.read_file(utils.path_from_root('src/shell.css'))) shell = shell.replace('{{{ SHELL_LOGO }}}', utils.read_file(utils.path_from_root('media/powered_by_logo_mini.svg'))) - shell = tools.line_endings.convert_line_endings(shell, '\n', options.output_eol) check_output_file(target) write_file(target, shell) @@ -4277,6 +4276,8 @@ def generate_html(target, options, js_target, target_basename, if settings.MINIFY_HTML and (settings.OPT_LEVEL >= 1 or settings.SHRINK_LEVEL >= 1): minify_html(target) + tools.line_endings.convert_line_endings_in_file(target, os.linesep, options.output_eol) + def generate_worker_js(target, js_target, target_basename): if settings.SINGLE_FILE: diff --git a/test/test_other.py b/test/test_other.py index 91e735597264..9dd716f03642 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -7904,6 +7904,7 @@ def test_disable_inlining(self): output = self.run_process([common.LLVM_OBJDUMP, '-t', 'test.o'], stdout=PIPE).stdout self.assertContained('foo', output) + @crossplatform def test_output_eol(self): for params in [[], ['--proxy-to-worker'], ['--proxy-to-worker', '-sWASM=0']]: for output_suffix in ['html', 'js']: @@ -7922,7 +7923,7 @@ def test_output_eol(self): expected_ending = '\r\n' ret = line_endings.check_line_endings(f, expect_only=expected_ending) - assert ret == 0 + self.assertEqual(ret, 0) for f in files: delete_file(f) @@ -9779,6 +9780,7 @@ def test_js_preprocess(self): self.assertContained('JSLIB: EXIT_RUNTIME', err) self.assertNotContained('JSLIB: MAIN_MODULE', err) + @crossplatform def test_html_preprocess(self): src_file = test_file('module/test_stdin.c') output_file = 'test_stdin.html' @@ -9786,7 +9788,7 @@ def test_html_preprocess(self): self.run_process([EMCC, '-o', output_file, src_file, '--shell-file', shell_file, '-sASSERTIONS=0'], stdout=PIPE, stderr=PIPE) output = read_file(output_file) - self.assertContained("""