Skip to content

Commit 8c067ea

Browse files
authored
Fix test_zzz_poppler, test_zzz_bullet, test_zzz_zlib benchmarks on Windows. (#25292)
Fix test_zzz_poppler, test_zzz_bullet, test_zzz_zlib benchmarks on Windows.
1 parent c530ad9 commit 8c067ea

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

test/common.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ def decorated(self, *args, **kwargs):
232232
return decorated
233233

234234

235+
def needs_make(note=''):
236+
assert not callable(note)
237+
if WINDOWS:
238+
return unittest.skip('Tool not available on Windows bots (%s)' % note)
239+
return lambda f: f
240+
241+
235242
def record_flaky_test(test_name, attempt_count, exception_msg):
236243
logging.info(f'Retrying flaky test "{test_name}" (attempt {attempt_count}/{EMTEST_RETRY_FLAKY} failed):\n{exception_msg}')
237244
open(flaky_tests_log_filename, 'a').write(f'{test_name}\n')

test/test_benchmark.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import jsrun
2323
import common
2424
from tools.shared import CLANG_CC, CLANG_CXX
25-
from common import test_file, read_file, read_binary
25+
from common import test_file, read_file, read_binary, needs_make
2626
from tools.shared import run_process, PIPE, EMCC, config
2727
from tools import building, utils, shared
2828

@@ -1006,7 +1006,7 @@ def test_zzz_zlib(self):
10061006
src = read_file(test_file('benchmark/test_zlib_benchmark.c'))
10071007

10081008
def lib_builder(name, native, env_init):
1009-
return self.get_library(os.path.join('third_party', 'zlib'), os.path.join('libz.a'), make_args=['libz.a'], native=native, cache_name_extra=name, env_init=env_init)
1009+
return self.get_library(os.path.join('third_party', 'zlib'), os.path.join('libz.a'), configure=['cmake', '-DCMAKE_POLICY_VERSION_MINIMUM=3.5', '.'], make=['cmake', '--build', '.', '--'], make_args=[], native=native, cache_name_extra=name, env_init=env_init)
10101010

10111011
self.do_benchmark('zlib', src, 'ok.',
10121012
force_c=True, shared_args=['-I' + test_file('third_party/zlib')], lib_builder=lib_builder)
@@ -1039,15 +1039,11 @@ def test_zzz_bullet(self):
10391039

10401040
def lib_builder(name, native, env_init):
10411041
return self.get_library(str(Path('third_party/bullet')),
1042-
[Path('src/.libs/libBulletDynamics.a'),
1043-
Path('src/.libs/libBulletCollision.a'),
1044-
Path('src/.libs/libLinearMath.a')],
1045-
# The --host parameter is needed for 2 reasons:
1046-
# 1) bullet in it's configure.ac tries to do platform detection and will fail on unknown platforms
1047-
# 2) configure will try to compile and run a test file to check if the C compiler is sane. As Cheerp
1048-
# will generate a wasm file (which cannot be run), configure will fail. Passing `--host` enables
1049-
# cross compile mode, which lets configure complete happily.
1050-
configure_args=['--disable-demos', '--disable-dependency-tracking', '--host=i686-unknown-linux'], native=native, cache_name_extra=name, env_init=env_init)
1042+
['src/BulletDynamics/libBulletDynamics.a',
1043+
'src/BulletCollision/libBulletCollision.a',
1044+
'src/LinearMath/libLinearMath.a'],
1045+
configure=['cmake', '.'], configure_args=['-DCMAKE_POLICY_VERSION_MINIMUM=3.5','-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF', '-DUSE_GLUT=OFF', '-DCMAKE_CXX_STANDARD=14'],
1046+
make=['cmake', '--build', '.', '--'], make_args=[], native=native, cache_name_extra=name, env_init=env_init)
10511047

10521048
self.do_benchmark('bullet', src, '\nok.\n',
10531049
shared_args=['-I' + test_file('third_party/bullet/src'), '-I' + test_file('third_party/bullet/Demos/Benchmarks')],
@@ -1070,6 +1066,7 @@ def test_zzz_sqlite(self):
10701066
emcc_args=['-sFILESYSTEM', '-sMINIMAL_RUNTIME=0'],
10711067
force_c=True)
10721068

1069+
@needs_make('depends on freetype')
10731070
def test_zzz_poppler(self):
10741071
utils.write_file('pre.js', '''
10751072
var benchmarkArgument = %s;

test/test_core.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from common import compiler_for, crossplatform, no_4gb, no_2gb, also_with_minimal_runtime, also_with_modularize
3131
from common import with_all_fs, also_with_nodefs, also_with_nodefs_both, also_with_noderawfs, also_with_wasmfs
3232
from common import with_all_eh_sjlj, with_all_sjlj, also_with_standalone_wasm, can_do_standalone, no_wasm64, requires_wasm_eh, requires_jspi
33-
from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER, PYTHON
33+
from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER, PYTHON, needs_make
3434
import clang_native
3535

3636
# decorators for limiting which modes a test can run in
@@ -265,13 +265,6 @@ def decorated(self):
265265
return decorator
266266

267267

268-
def needs_make(note=''):
269-
assert not callable(note)
270-
if WINDOWS:
271-
return unittest.skip('Tool not available on Windows bots (%s)' % note)
272-
return lambda f: f
273-
274-
275268
def no_asan(note):
276269
assert not callable(note)
277270

0 commit comments

Comments
 (0)