aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py62
1 files changed, 37 insertions, 25 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index f67d820a..2feb85fb 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4841,33 +4841,45 @@ def process(filename):
no_build=True)
def test_sqlite(self):
- # gcc -O3 -I/home/alon/Dev/emscripten/tests/sqlite -ldl src.c
- if self.emcc_args is None: return self.skip('Very slow without ta2, and we would also need to include dlmalloc manually without emcc')
- if not self.is_emscripten_abi(): return self.skip('fails on x86 due to a legalization issue on llvm 3.3')
- if Settings.QUANTUM_SIZE == 1: return self.skip('TODO FIXME')
- self.banned_js_engines = [NODE_JS] # OOM in older node
+ try:
+ if self.run_name == 'slow2' or self.run_name == 'slow2asm':
+ old_target = os.environ.get('EMCC_LLVM_TARGET') or ''
+ os.environ['EMCC_LLVM_TARGET'] = "le32-unknown-nacl"
- Settings.CORRECT_SIGNS = 1
- Settings.CORRECT_OVERFLOWS = 0
- Settings.CORRECT_ROUNDINGS = 0
- if self.emcc_args is None: Settings.SAFE_HEAP = 0 # uses time.h to set random bytes, other stuff
- Settings.DISABLE_EXCEPTION_CATCHING = 1
- Settings.FAST_MEMORY = 4*1024*1024
- Settings.EXPORTED_FUNCTIONS += ['_sqlite3_open', '_sqlite3_close', '_sqlite3_exec', '_sqlite3_free', '_callback'];
- if Settings.ASM_JS == 1 and '-g' in self.emcc_args:
- print "disabling inlining" # without registerize (which -g disables), we generate huge amounts of code
- Settings.INLINING_LIMIT = 50
+ # gcc -O3 -I/home/alon/Dev/emscripten/tests/sqlite -ldl src.c
+ if self.emcc_args is None: return self.skip('Very slow without ta2, and we would also need to include dlmalloc manually without emcc')
+ if not self.is_emscripten_abi(): return self.skip('fails on x86 due to a legalization issue on llvm 3.3')
+ if Settings.QUANTUM_SIZE == 1: return self.skip('TODO FIXME')
+ self.banned_js_engines = [NODE_JS] # OOM in older node
- self.do_run(r'''
- #define SQLITE_DISABLE_LFS
- #define LONGDOUBLE_TYPE double
- #define SQLITE_INT64_TYPE long long int
- #define SQLITE_THREADSAFE 0
- ''' + open(path_from_root('tests', 'sqlite', 'sqlite3.c'), 'r').read() +
- open(path_from_root('tests', 'sqlite', 'benchmark.c'), 'r').read(),
- open(path_from_root('tests', 'sqlite', 'benchmark.txt'), 'r').read(),
- includes=[path_from_root('tests', 'sqlite')],
- force_c=True)
+ Settings.CORRECT_SIGNS = 1
+ Settings.CORRECT_OVERFLOWS = 0
+ Settings.CORRECT_ROUNDINGS = 0
+ if self.emcc_args is None: Settings.SAFE_HEAP = 0 # uses time.h to set random bytes, other stuff
+ Settings.DISABLE_EXCEPTION_CATCHING = 1
+ Settings.FAST_MEMORY = 4*1024*1024
+ Settings.EXPORTED_FUNCTIONS += ['_sqlite3_open', '_sqlite3_close', '_sqlite3_exec', '_sqlite3_free', '_callback'];
+ if Settings.ASM_JS == 1 and '-g' in self.emcc_args:
+ print "disabling inlining" # without registerize (which -g disables), we generate huge amounts of code
+ Settings.INLINING_LIMIT = 50
+
+ self.do_run(r'''
+ #define SQLITE_DISABLE_LFS
+ #define LONGDOUBLE_TYPE double
+ #define SQLITE_INT64_TYPE long long int
+ #define SQLITE_THREADSAFE 0
+ ''' + open(path_from_root('tests', 'sqlite', 'sqlite3.c'), 'r').read() +
+ open(path_from_root('tests', 'sqlite', 'benchmark.c'), 'r').read(),
+ open(path_from_root('tests', 'sqlite', 'benchmark.txt'), 'r').read(),
+ includes=[path_from_root('tests', 'sqlite')],
+ force_c=True)
+
+ finally:
+ if self.run_name == 'slow2' or self.run_name == 'slow2asm':
+ if old_target:
+ os.environ['EMCC_LLVM_TARGET'] = old_target
+ else:
+ del os.environ['EMCC_LLVM_TARGET']
def test_zlib(self):
if not Settings.USE_TYPED_ARRAYS == 2: return self.skip('works in general, but cached build will be optimized and fail, so disable this')