diff --git a/test/common.py b/test/common.py index 1ef219f46c4f7..e1f9d8fc8f55f 100644 --- a/test/common.py +++ b/test/common.py @@ -232,6 +232,13 @@ def decorated(self, *args, **kwargs): return decorated +def needs_make(note=''): + assert not callable(note) + if WINDOWS: + return unittest.skip('Tool not available on Windows bots (%s)' % note) + return lambda f: f + + def record_flaky_test(test_name, attempt_count, exception_msg): logging.info(f'Retrying flaky test "{test_name}" (attempt {attempt_count}/{EMTEST_RETRY_FLAKY} failed):\n{exception_msg}') open(flaky_tests_log_filename, 'a').write(f'{test_name}\n') diff --git a/test/test_benchmark.py b/test/test_benchmark.py index b89daf68265bf..fe48c5b63a16d 100644 --- a/test/test_benchmark.py +++ b/test/test_benchmark.py @@ -22,7 +22,7 @@ import jsrun import common from tools.shared import CLANG_CC, CLANG_CXX -from common import test_file, read_file, read_binary +from common import test_file, read_file, read_binary, needs_make from tools.shared import run_process, PIPE, EMCC, config from tools import building, utils, shared @@ -1006,7 +1006,7 @@ def test_zzz_zlib(self): src = read_file(test_file('benchmark/test_zlib_benchmark.c')) def lib_builder(name, native, env_init): - 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) + 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) self.do_benchmark('zlib', src, 'ok.', force_c=True, shared_args=['-I' + test_file('third_party/zlib')], lib_builder=lib_builder) @@ -1039,15 +1039,11 @@ def test_zzz_bullet(self): def lib_builder(name, native, env_init): return self.get_library(str(Path('third_party/bullet')), - [Path('src/.libs/libBulletDynamics.a'), - Path('src/.libs/libBulletCollision.a'), - Path('src/.libs/libLinearMath.a')], - # The --host parameter is needed for 2 reasons: - # 1) bullet in it's configure.ac tries to do platform detection and will fail on unknown platforms - # 2) configure will try to compile and run a test file to check if the C compiler is sane. As Cheerp - # will generate a wasm file (which cannot be run), configure will fail. Passing `--host` enables - # cross compile mode, which lets configure complete happily. - configure_args=['--disable-demos', '--disable-dependency-tracking', '--host=i686-unknown-linux'], native=native, cache_name_extra=name, env_init=env_init) + ['src/BulletDynamics/libBulletDynamics.a', + 'src/BulletCollision/libBulletCollision.a', + 'src/LinearMath/libLinearMath.a'], + configure=['cmake', '.'], configure_args=['-DCMAKE_POLICY_VERSION_MINIMUM=3.5','-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF', '-DUSE_GLUT=OFF', '-DCMAKE_CXX_STANDARD=14'], + make=['cmake', '--build', '.', '--'], make_args=[], native=native, cache_name_extra=name, env_init=env_init) self.do_benchmark('bullet', src, '\nok.\n', 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): emcc_args=['-sFILESYSTEM', '-sMINIMAL_RUNTIME=0'], force_c=True) + @needs_make('depends on freetype') def test_zzz_poppler(self): utils.write_file('pre.js', ''' var benchmarkArgument = %s; diff --git a/test/test_core.py b/test/test_core.py index 0c2d01624130a..a1c2f7d40e9d8 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -30,7 +30,7 @@ from common import compiler_for, crossplatform, no_4gb, no_2gb, also_with_minimal_runtime, also_with_modularize from common import with_all_fs, also_with_nodefs, also_with_nodefs_both, also_with_noderawfs, also_with_wasmfs from common import with_all_eh_sjlj, with_all_sjlj, also_with_standalone_wasm, can_do_standalone, no_wasm64, requires_wasm_eh, requires_jspi -from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER, PYTHON +from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER, PYTHON, needs_make import clang_native # decorators for limiting which modes a test can run in @@ -265,13 +265,6 @@ def decorated(self): return decorator -def needs_make(note=''): - assert not callable(note) - if WINDOWS: - return unittest.skip('Tool not available on Windows bots (%s)' % note) - return lambda f: f - - def no_asan(note): assert not callable(note)