Skip to content

Commit f51d380

Browse files
committed
Use sqlite3 port in test_sqlite
1 parent dbe4506 commit f51d380

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

tests/test_core.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6665,37 +6665,23 @@ def test_freetype(self):
66656665
@no_asan('local count too large for VMs')
66666666
@no_ubsan('local count too large for VMs')
66676667
@is_slow_test
6668-
def test_sqlite(self):
6668+
@parameterized({
6669+
'single': (False,),
6670+
'pthreads': (True,),
6671+
})
6672+
def test_sqlite(self, use_pthreads):
6673+
if use_pthreads:
6674+
self.set_setting('USE_PTHREADS')
6675+
self.setup_node_pthreads()
66696676
self.set_setting('EXPORTED_FUNCTIONS', ['_main', '_sqlite3_open', '_sqlite3_close', '_sqlite3_exec', '_sqlite3_free'])
66706677
if '-g' in self.emcc_args:
66716678
print("disabling inlining") # without registerize (which -g disables), we generate huge amounts of code
66726679
self.set_setting('INLINING_LIMIT')
66736680

6674-
# newer clang has a warning for implicit conversions that lose information,
6675-
# which happens in sqlite (see #9138)
6676-
self.emcc_args += ['-Wno-implicit-int-float-conversion']
6677-
# newer clang warns about "suspicious concatenation of string literals in an
6678-
# array initialization; did you mean to separate the elements with a comma?"
6679-
self.emcc_args += ['-Wno-string-concatenation']
6680-
# ignore unknown flags, which lets the above flags be used on github CI
6681-
# before the LLVM change rolls in (the same LLVM change that adds the
6682-
# warning also starts to warn on it)
6683-
self.emcc_args += ['-Wno-unknown-warning-option']
6684-
self.emcc_args += ['-Wno-pointer-bool-conversion']
6685-
6686-
self.emcc_args += ['-I' + test_file('third_party/sqlite')]
6687-
6688-
src = '''
6689-
#define SQLITE_DISABLE_LFS
6690-
#define LONGDOUBLE_TYPE double
6691-
#define SQLITE_INT64_TYPE long long int
6692-
#define SQLITE_THREADSAFE 0
6693-
'''
6694-
src += read_file(test_file('third_party/sqlite/sqlite3.c'))
6695-
src += read_file(test_file('sqlite/benchmark.c'))
6681+
self.emcc_args += ['-sUSE_SQLITE3']
6682+
src = read_file(test_file('sqlite/benchmark.c'))
66966683
self.do_run(src,
66976684
read_file(test_file('sqlite/benchmark.txt')),
6698-
includes=[test_file('sqlite')],
66996685
force_c=True)
67006686

67016687
@needs_make('mingw32-make')

0 commit comments

Comments
 (0)