Skip to content
Merged
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
23 changes: 23 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -15079,10 +15079,33 @@ def test_embind_negative_enum_values(self):

@crossplatform
def test_no_extra_output(self):
# Run this build command first to warm the cache (since caching can produce stdout).
self.run_process([EMCC, '-c', test_file('hello_world.c')])
output = self.run_process([EMCC, '-c', test_file('hello_world.c')], stdout=PIPE, stderr=STDOUT).stdout
self.assertEqual(output, '')

@crossplatform
def test_shell_cmd_with_quotes(self):
file = test_file('hello_world.c')
# Run this build command first to warm the cache (since caching can produce stdout).
self.run_process([EMCC, '-c', file])

# Verify that "emcc" is found in the PATH correctly in shell scripts (shell=True).
# (Specifically when quotes are around the "emcc" command itself).
# See https://github.com/microsoft/terminal/issues/15212
old_path = os.environ['PATH']
new_path = old_path + os.pathsep + os.path.dirname(EMCC)
cmd = f'"emcc" -c "{file}"'
print('running cmd:', cmd)
with env_modify({'PATH': new_path}):
proc = subprocess.run(cmd, capture_output=True, text=True, shell=True, check=True)
# There is currently a bug in the windows .bat files that leads to stdout
# not being empty in this case.
# See https://github.com/emscripten-core/emscripten/pull/25416
if not WINDOWS:
self.assertEqual(proc.stdout, '')
self.assertEqual(proc.stderr, '')

def test_browser_too_old(self):
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMIN_CHROME_VERSION=10'])
self.assertContained('emcc: error: MIN_CHROME_VERSION older than 74 is not supported', err)
Expand Down