Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -10766,6 +10766,22 @@ def test_html_preprocess(self):
T5:ASSERTIONS
T6:(else) !ASSERTIONS""", output)

def test_html_preprocess_minimal_runtime(self):
# With MINIMAL_RUNTIME it is a temporary copy of the shell file that gets
# preprocessed. Verify that `<style>` blocks are left alone there too.
create_file('shell.html', '''\
<style>
#foo {}
</style>
#if MINIMAL_RUNTIME
minimal
#endif
{{{ DOWNLOAD_JS_AND_WASM_FILES }}}
''')
self.run_process([EMCC, test_file('hello_world.c'), '-o', 'out.html', '-sMINIMAL_RUNTIME', '--shell-file', 'shell.html'])
output = read_file('out.html')
self.assertContained('<style>\n#foo {}\n</style>\nminimal\n', output)

def test_shell_file_unused(self):
create_file('foo.html', '')
expected = 'emcc: error: --shell-file ignored when not generating html output [-Wunused-command-line-argument] [-Werror]'
Expand Down
2 changes: 1 addition & 1 deletion tools/minimal_runtime_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def generate_minimal_runtime_html(target, js_target, target_basename):
shell = shell.replace('{{{ DOWNLOAD_JS_AND_WASM_FILES }}}', generate_minimal_runtime_load_statement(target_basename))

temp_files = shared.get_temp_files()
with temp_files.get_file(suffix='.js') as shell_temp:
with temp_files.get_file(suffix='.html') as shell_temp:
utils.write_file(shell_temp, shell)
shell = building.read_and_preprocess(shell_temp)

Expand Down
Loading