Skip to content

Commit b29aada

Browse files
authored
Speed up test_windows_long_link_response_file. NFC (#25388)
Reducing the number of files from 1000 to 300 makes the test run in 20 seconds rather than 60 seconds on my machine.
1 parent 3bad024 commit b29aada

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/test_other.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12973,7 +12973,7 @@ def test_em_js_top_level(self):
1297312973
self.do_runf('main.c', 'Top level code\nhello from pre-run\njs_func called\n')
1297412974

1297512975
# On Windows maximum command line length is 32767 characters. Create such a long build line by linking together
12976-
# several .o files to test that emcc internally uses response files properly when calling llvm-nm and wasm-ld.
12976+
# several .o files to test that emcc internally uses response files properly when calling wasm-ld.
1297712977
@is_slow_test
1297812978
def test_windows_long_link_response_file(self):
1297912979
decls = ''
@@ -12988,16 +12988,17 @@ def create_o(name, i):
1298812988
decls += 'int %s();' % name
1298912989
calls += 'value += %s();' % name
1299012990

12991-
count = 1000
12991+
count = 300
1299212992
for i in range(count):
1299312993
name = 'a' + str(i)
12994-
for _ in range(5):
12995-
name += name
12994+
name = name * 32
1299612995
create_o(name, i)
1299712996

1299812997
create_file('main.c', '#include<stdio.h>\n%s int main() { int value = 0; %s printf("%%d\\n", value); }' % (decls, calls))
1299912998

13000-
assert sum(len(f) for f in files) > 32767
12999+
total_len = sum(len(f) for f in files)
13000+
print('Command line lower bound:', total_len)
13001+
assert total_len > 32767
1300113002

1300213003
self.run_process(building.get_command_with_possible_response_file([EMCC, 'main.c'] + files))
1300313004
self.assertContained(str(count * (count - 1) // 2), self.run_js('a.out.js'))

0 commit comments

Comments
 (0)