Skip to content

Commit

Permalink
Simplify test_sqlite. NFC (#17712)
Browse files Browse the repository at this point in the history
Also, ensure we don't pass `force_c` in tests that don't need it.
  • Loading branch information
sbc100 authored Aug 24, 2022
1 parent 0563c4c commit d4cf40c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ def build(self, filename, libraries=None, includes=None, force_c=False, js_outfi
compiler.append('-sNO_DEFAULT_TO_CXX')

if force_c:
assert shared.suffix(filename) != '.c', 'force_c is not needed for source files ending in .c'
compiler.append('-xc')

if output_basename:
Expand Down
File renamed without changes.
10 changes: 3 additions & 7 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3806,7 +3806,7 @@ def test_dlfcn_longjmp(self):
pre 8
pre 9
out!
''', force_c=True)
''')

# TODO: make this work. need to forward tempRet0 across modules
# TODO Enable @with_both_eh_sjlj (the test is not working now)
Expand Down Expand Up @@ -4025,7 +4025,7 @@ def dylink_test(self, main, side, expected=None, header=None, force_c=False,
if header:
create_file('header.h', header)

return self.dylink_testf(main, side, expected, force_c, main_module=main_module, **kwargs)
return self.dylink_testf(main, side, expected, main_module=main_module, **kwargs)

def dylink_testf(self, main, side=None, expected=None, force_c=False, main_emcc_args=None,
main_module=2,
Expand Down Expand Up @@ -6736,11 +6736,7 @@ def test_sqlite(self, use_pthreads):
self.set_setting('USE_PTHREADS')
self.setup_node_pthreads()
self.emcc_args += ['-sUSE_SQLITE3']
self.do_run_from_file(
test_file('sqlite/benchmark.c'),
test_file('sqlite/benchmark.txt'),
force_c=True
)
self.do_run_in_out_file_test(test_file('sqlite/benchmark.c'))

@needs_make('mingw32-make')
@is_slow_test
Expand Down

0 comments on commit d4cf40c

Please sign in to comment.