Skip to content

Commit 416e5b1

Browse files
committed
Fix warnings in tsgen tests. NFC
Also don't report clearing of out/test between each test, which makes the test runner less chatty by default.
1 parent 1e8e824 commit 416e5b1

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

test/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,14 +894,14 @@ def setUp(self):
894894
if EMTEST_SAVE_DIR == 2:
895895
print('Not clearing existing test directory')
896896
else:
897-
print('Clearing existing test directory')
897+
logger.debug('Clearing existing test directory: %s', self.working_dir)
898898
# Even when --save-dir is used we still try to start with an empty directory as many tests
899899
# expect this. --no-clean can be used to keep the old contents for the new test
900900
# run. This can be useful when iterating on a given test with extra files you want to keep
901901
# around in the output directory.
902902
force_delete_contents(self.working_dir)
903903
else:
904-
print('Creating new test output directory')
904+
logger.debug('Creating new test output directory: %s', self.working_dir)
905905
ensure_dir(self.working_dir)
906906
utils.write_file(LAST_TEST, self.id() + '\n')
907907
os.chdir(self.working_dir)

test/test_other.py

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3023,25 +3023,26 @@ def test_embind_tsgen_ignore(self):
30233023
create_file('fail.js', 'assert(false);')
30243024
# These extra arguments are not related to TS binding generation but we want to
30253025
# verify that they do not interfere with it.
3026-
extra_args = ['-sALLOW_MEMORY_GROWTH=1',
3027-
'-sMAXIMUM_MEMORY=4GB',
3028-
'--pre-js', 'fail.js',
3029-
'--post-js', 'fail.js',
3030-
'--extern-pre-js', 'fail.js',
3031-
'--extern-post-js', 'fail.js',
3032-
'-sENVIRONMENT=worker',
3033-
'--use-preload-cache',
3034-
'--preload-file', 'fail.js',
3035-
'-O3',
3036-
'-msimd128',
3037-
'-sUSE_PTHREADS',
3038-
'-sPROXY_TO_PTHREAD',
3039-
'-sPTHREAD_POOL_SIZE=1',
3040-
'-sSINGLE_FILE',
3041-
'-lembind', # Test duplicated link option.
3042-
]
3026+
self.emcc_args += ['-sALLOW_MEMORY_GROWTH=1',
3027+
'-Wno-pthreads-mem-growth',
3028+
'-sMAXIMUM_MEMORY=4GB',
3029+
'--pre-js', 'fail.js',
3030+
'--post-js', 'fail.js',
3031+
'--extern-pre-js', 'fail.js',
3032+
'--extern-post-js', 'fail.js',
3033+
'-sENVIRONMENT=worker',
3034+
'--use-preload-cache',
3035+
'--preload-file', 'fail.js',
3036+
'-O3',
3037+
'-msimd128',
3038+
'-pthread',
3039+
'-sPROXY_TO_PTHREAD',
3040+
'-sPTHREAD_POOL_SIZE=1',
3041+
'-sSINGLE_FILE',
3042+
'-lembind', # Test duplicated link option.
3043+
]
30433044
self.run_process([EMCC, test_file('other/embind_tsgen.cpp'),
3044-
'-lembind', '--embind-emit-tsd', 'embind_tsgen.d.ts'] + extra_args)
3045+
'-lembind', '--embind-emit-tsd', 'embind_tsgen.d.ts'] + self.get_emcc_args())
30453046
self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
30463047
# Test these args separately since they conflict with arguments in the first test.
30473048
extra_args = ['-sMODULARIZE',
@@ -3055,7 +3056,11 @@ def test_embind_tsgen_ignore(self):
30553056
def test_embind_tsgen_test_embind(self):
30563057
self.run_process([EMCC, test_file('embind/embind_test.cpp'),
30573058
'-lembind', '--embind-emit-tsd', 'embind_tsgen_test_embind.d.ts',
3058-
'-DSKIP_UNBOUND_TYPES']) # TypeScript generation requires all type to be bound.
3059+
# This test explicitly creates std::string from unsigned char pointers
3060+
# which is deprecated in upstream LLVM.
3061+
'-Wno-deprecated-declarations',
3062+
# TypeScript generation requires all type to be bound.
3063+
'-DSKIP_UNBOUND_TYPES'] + self.get_emcc_args())
30593064
self.assertExists('embind_tsgen_test_embind.d.ts')
30603065

30613066
def test_embind_tsgen_val(self):
@@ -3076,7 +3081,8 @@ def test_embind_tsgen_bigint(self):
30763081
def test_embind_tsgen_memory64(self):
30773082
# Check that when memory64 is enabled longs & unsigned longs are mapped to bigint in the generated TS bindings
30783083
self.run_process([EMCC, test_file('other/embind_tsgen_memory64.cpp'),
3079-
'-lembind', '--embind-emit-tsd', 'embind_tsgen_memory64.d.ts', '-sMEMORY64'])
3084+
'-lembind', '--embind-emit-tsd', 'embind_tsgen_memory64.d.ts', '-sMEMORY64', '-Wno-experimental'] +
3085+
self.get_emcc_args())
30803086
self.assertFileContents(test_file('other/embind_tsgen_memory64.d.ts'), read_file('embind_tsgen_memory64.d.ts'))
30813087

30823088
def test_emconfig(self):

0 commit comments

Comments
 (0)