Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
19 changes: 8 additions & 11 deletions test/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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')],
Expand All @@ -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;
Expand Down
9 changes: 1 addition & 8 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down