aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-02 11:04:30 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-02 11:04:30 -0700
commit48a9f644fab7099a5ec6c558109842ca486f794a (patch)
tree4bdbee49228c7ec156d17bc0054285eec683d166 /tests/runner.py
parent61d8808b5342e56eb3a6a6cbb599d7f92ee85134 (diff)
also use LLVM_ROOT to detect when we need to clear the cache
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index ed4f334c..9f037164 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -14927,12 +14927,30 @@ fi
finally:
del os.environ['EMCC_DEBUG']
+ restore()
+
+ def ensure_cache():
+ self.do([EMCC, '-O2', path_from_root('tests', 'hello_world.c')])
+
# Manual cache clearing
+ ensure_cache()
assert os.path.exists(EMCC_CACHE)
output = self.do([EMCC, '--clear-cache'])
assert ERASING_MESSAGE in output
assert not os.path.exists(EMCC_CACHE)
+ # Changing LLVM_ROOT, even without altering .emscripten, clears the cache
+ ensure_cache()
+ old = os.environ.get('LLVM')
+ try:
+ os.environ['LLVM'] = 'waka'
+ assert os.path.exists(EMCC_CACHE)
+ output = self.do([EMCC])
+ assert ERASING_MESSAGE in output
+ assert not os.path.exists(EMCC_CACHE)
+ finally:
+ if old: os.environ['LLVM'] = old
+
try_delete(CANONICAL_TEMP_DIR)
def test_relooper(self):