Skip to content

Commit 9f751bb

Browse files
authored
Remove re-invoke of test/runner from test_sanity. NFC (#25869)
This list of commands dates back all way to 2011: 0e8e6a8. However I don't see any reason not just test emcc here. Being able to re-invoke the test runner from withing the test runner doesn't seem like a useful/required thing. This list of was only used in 2 tests cases, and I think just removing the list makes the tests easier to understand. Fixes: #25868
1 parent b8b3e2a commit 9f751bb

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

test/test_sanity.py

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from tools.utils import delete_dir, delete_file
3232

3333
SANITY_FILE = cache.get_path('sanity.txt')
34-
commands = [[EMCC], [shared.bat_suffix(path_from_root('test/runner')), 'blahblah']]
3534
expected_llvm_version = str(shared.EXPECTED_LLVM_VERSION) + '.0.0'
3635

3736

@@ -175,10 +174,7 @@ def check_working(self, command, expected=None, env=None):
175174
if command == [EMCC]:
176175
command = [EMCC, '--version']
177176
if expected is None:
178-
if command[0] == EMCC or (len(command) >= 2 and command[1] == EMCC):
179-
expected = 'emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld)'
180-
else:
181-
expected = 'could not find the following tests: blahblah'
177+
expected = 'emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld)'
182178

183179
output = self.do(command, env=env)
184180
self.assertContained(expected, output)
@@ -187,10 +183,9 @@ def check_working(self, command, expected=None, env=None):
187183
# this should be the very first thing that runs. if this fails, everything else is irrelevant!
188184
@crossplatform
189185
def test_aaa_normal(self):
190-
for command in commands:
191-
# Your existing EM_CONFIG should work!
192-
restore_and_set_up()
193-
self.check_working(command)
186+
# Your existing EM_CONFIG should work!
187+
restore_and_set_up()
188+
self.check_working(EMCC)
194189

195190
@with_env_modify({'EM_CONFIG': None})
196191
def test_firstrun(self):
@@ -245,19 +240,18 @@ def make_new_executable(name):
245240
# output = self.run_process([EMCC, test_file('hello_world.c')], stdout=PIPE, stderr=PIPE).output
246241
# self.assertContained('hello, world!', self.run_js('a.out.js'), output)
247242

248-
for command in commands:
249-
# Second run, with bad EM_CONFIG
250-
for settings in ('blah', 'LLVM_ROOT="blarg"; JS_ENGINES=[]; NODE_JS=[]; SPIDERMONKEY_ENGINE=[]'):
251-
try:
252-
utils.write_file(default_config, settings)
253-
output = self.do(command)
254-
255-
if 'blah' in settings:
256-
self.assertContained('error: error in evaluating config file (%s)' % default_config, output)
257-
elif 'runner' not in ' '.join(command):
258-
self.assertContained('error: NODE_JS is set to empty value', output) # sanity check should fail
259-
finally:
260-
delete_file(default_config)
243+
# Second run, with bad EM_CONFIG
244+
for settings in ('blah', 'LLVM_ROOT="blarg"; JS_ENGINES=[]; NODE_JS=[]; SPIDERMONKEY_ENGINE=[]'):
245+
try:
246+
utils.write_file(default_config, settings)
247+
output = self.do(EMCC)
248+
249+
if 'blah' in settings:
250+
self.assertContained('error: error in evaluating config file (%s)' % default_config, output)
251+
else:
252+
self.assertContained('error: NODE_JS is set to empty value', output) # sanity check should fail
253+
finally:
254+
delete_file(default_config)
261255

262256
@no_windows('Test relies on Unix-specific make_fake_tool')
263257
def test_llvm(self):

0 commit comments

Comments
 (0)