aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/tests/runner.py b/tests/runner.py
index fa4da081..1cb84084 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -30,7 +30,7 @@ from tools.shared import *
try:
assert COMPILER_OPTS != None
except:
- raise Exception('Cannot find "COMPILER_OPTS" definition. Is ~/.emscripten set up properly? You may need to copy the template from settings.py into it.')
+ raise Exception('Cannot find "COMPILER_OPTS" definition. Is %s set up properly? You may need to copy the template from settings.py into it.' % EM_CONFIG)
# Core test runner class, shared between normal tests and benchmarks
@@ -291,7 +291,7 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv):
if Settings.USE_TYPED_ARRAYS:
js_engines = filter(lambda engine: engine != V8_ENGINE, js_engines) # V8 issue 1822
js_engines = filter(lambda engine: engine not in self.banned_js_engines, js_engines)
- if len(js_engines) == 0: return self.skip('No JS engine present to run this test with. Check ~/.emscripten and settings.py and the paths therein.')
+ if len(js_engines) == 0: return self.skip('No JS engine present to run this test with. Check %s and settings.py and the paths therein.' % EM_CONFIG)
for engine in js_engines:
engine = filter(lambda arg: arg != '-n', engine) # SpiderMonkey issue 716255
js_output = self.run_generated_code(engine, filename + '.o.js', args)
@@ -3628,6 +3628,24 @@ def process(filename):
'''
self.do_run(src, re.sub('(^|\n)\s+', '\\1', expected), post_build=add_pre_run_and_checks)
+ def test_direct_string_constant_usage(self):
+ if self.emcc_args is None: return self.skip('requires libcxx')
+
+ src = '''
+ #include <iostream>
+ template<int i>
+ void printText( const char (&text)[ i ] )
+ {
+ std::cout << text;
+ }
+ int main()
+ {
+ printText( "some string constant" );
+ return 0;
+ }
+ '''
+ self.do_run(src, "some string constant")
+
def test_fs_base(self):
Settings.INCLUDE_FULL_LIBRARY = 1
try:
@@ -5947,10 +5965,10 @@ elif 'sanity' in str(sys.argv):
print
print 'Running sanity checks.'
- print 'WARNING: This will modify ~/.emscripten, and in theory can break it although it should be restored properly. A backup will be saved in ~/.emscripten_backup'
+ print 'WARNING: This will modify %s, and in theory can break it although it should be restored properly. A backup will be saved in %s_backup' % (EM_CONFIG, EM_CONFIG)
print
- assert os.path.exists(CONFIG_FILE), 'To run these tests, we need a (working!) ~/.emscripten file to already exist'
+ assert os.path.exists(CONFIG_FILE), 'To run these tests, we need a (working!) %s file to already exist' % EM_CONFIG
shutil.copyfile(CONFIG_FILE, CONFIG_FILE + '_backup')
def restore():
@@ -5995,7 +6013,7 @@ elif 'sanity' in str(sys.argv):
def test_aaa_normal(self): # this should be the very first thing that runs. if this fails, everything else is irrelevant!
for command in commands:
- # Your existing ~/.emscripten should work!
+ # Your existing EM_CONFIG should work!
restore()
self.check_working(command)
@@ -6006,14 +6024,14 @@ elif 'sanity' in str(sys.argv):
self.assertContained('Welcome to Emscripten!', output)
self.assertContained('This is the first time any of the Emscripten tools has been run.', output)
- self.assertContained('A settings file has been copied to ~/.emscripten, at absolute path: %s' % CONFIG_FILE, output)
+ self.assertContained('A settings file has been copied to %s, at absolute path: %s' % (EM_CONFIG, CONFIG_FILE), output)
self.assertContained('Please edit that file and change the paths to fit your system', output)
self.assertContained('make sure LLVM_ROOT and NODE_JS are correct', output)
self.assertContained('This command will now exit. When you are done editing those paths, re-run it.', output)
assert output.replace('\n', '').endswith('===='), 'We should have stopped: ' + output
assert (open(CONFIG_FILE).read() == open(path_from_root('settings.py')).read()), 'Settings should be copied from settings.py'
- # Second run, with bad ~/.emscripten
+ # Second run, with bad EM_CONFIG
for settings in ['blah', 'LLVM_ROOT="blah"; JS_ENGINES=[]; COMPILER_ENGINE=NODE_JS=SPIDERMONKEY_ENGINE=[]']:
f = open(CONFIG_FILE, 'w')
f.write(settings)
@@ -6021,7 +6039,7 @@ elif 'sanity' in str(sys.argv):
output = self.do(command)
if 'LLVM_ROOT' not in settings:
- self.assertContained('Error in evaluating ~/.emscripten', output)
+ self.assertContained('Error in evaluating %s' % EM_CONFIG, output)
else:
self.assertContained('FATAL', output) # sanity check should fail
@@ -6057,7 +6075,7 @@ elif 'sanity' in str(sys.argv):
SANITY_MESSAGE = 'Emscripten: Running sanity checks'
SANITY_FAIL_MESSAGE = 'sanity check failed to run'
- # emcc should check sanity if no ~/.emscripten_sanity
+ # emcc should check sanity if no ${EM_CONFIG}_sanity
restore()
time.sleep(0.1)
assert not os.path.exists(SANITY_FILE) # restore is just the settings, not the sanity