aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorSigmund Vik <sigmund_vik@yahoo.com>2012-04-11 21:25:18 +0200
committerSigmund Vik <sigmund_vik@yahoo.com>2012-04-11 21:25:18 +0200
commit99c46475c1944c1e62e04f30bd0db3233639515d (patch)
tree04e4bb82e9c0021d3c7ebf398e270f05545981e8 /tests/runner.py
parentc5b8395899bdd763a51f0385178e45a29eda711c (diff)
Make it easier to use emscripten from a build system.
- Allow the configuration to be specified directly in the EM_CONFIG environment variable instead of in a config file. The config file approach has some shortcomings when using emscripten from a build system (e.g. it uses a single global config file so it is hard to configure emscripten in different ways from different build trees). The presence of newlines in the EM_CONFIG string variable is used to decide if the configuration is stored directly in the environment variable or it is used to specify the config file (is this too much of a hack?). - Skip check_sanity() and check_engine() based on the presence of the config file. When running from a build system, it is the build system's responsibility that everything is set up correctly. Maybe a new environment variable EM_SKIP_CHECKS or something like that might be better to decide whether or not to run these checks? - Do not assume that the SPIDERMONKEY_ENGINE environment variable is set. - Add EM_CACHE environment variable that can be used to control where emscripten should store built libraries.
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 40f721d2..131eca10 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7500,6 +7500,24 @@ elif 'sanity' in str(sys.argv):
assert mtime(SANITY_FILE) >= mtime(CONFIG_FILE)
self.assertNotContained(SANITY_FAIL_MESSAGE, output)
+ # emcc should be configurable directly from EM_CONFIG without any config file
+ restore()
+ config = open(CONFIG_FILE, 'r').read()
+ os.environ['EM_CONFIG'] = config
+ wipe()
+ dirname = tempfile.mkdtemp(prefix='emscripten_test_' + self.__class__.__name__ + '_', dir=TEMP_DIR)
+ open(os.path.join(dirname, 'main.cpp'), 'w').write('''
+ #include <stdio.h>
+ int main() {
+ printf("hello from emcc with no CONFIG_FILE\\n");
+ return 0;
+ }
+ ''')
+ Popen(['python', EMCC, os.path.join(dirname, 'main.cpp'), '-o', os.path.join(dirname, 'a.out.js')]).communicate()
+ self.assertContained('hello from emcc with no CONFIG_FILE', run_js(os.path.join(dirname, 'a.out.js')))
+ del os.environ['EM_CONFIG']
+ shutil.rmtree(dirname)
+
def test_emcc_caching(self):
INCLUDING_MESSAGE = 'emcc: including X'
BUILDING_MESSAGE = 'emcc: building X for cache'