aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 5a53c059..0aefb8e1 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -413,7 +413,7 @@ process(sys.argv[1])
int suppInt = 76;
'''
- supp_name = os.path.join(self.get_dir(), 'supp.c')
+ supp_name = os.path.join(self.get_dir(), 'supp.cpp')
open(supp_name, 'w').write(supp)
main = r'''
@@ -4346,10 +4346,11 @@ The current type of b is: 9
# This will fail! See explanation near the warning we check for, in the compiler source code
output = Popen([PYTHON, EMCC, all_name], stderr=PIPE).communicate()
+
# Check for warning in the generated code
generated = open(os.path.join(self.get_dir(), 'src.cpp.o.js')).read()
if 'i386-pc-linux-gnu' in COMPILER_OPTS:
- assert 'Casting a function pointer type to another with a different number of arguments' in output[1], 'Missing expected warning'
+ assert 'Casting a function pointer type to a potentially incompatible one' in output[1], 'Missing expected warning'
else:
print >> sys.stderr, 'skipping C/C++ conventions warning check, since not i386-pc-linux-gnu'
@@ -5027,8 +5028,8 @@ The current type of b is: 9
Settings.BUILD_AS_SHARED_LIB = 2
Settings.NAMED_GLOBALS = 1
- self.build(supp, self.get_dir(), self.in_dir('supp.c'))
- shutil.move(self.in_dir('supp.c.o.js'), self.in_dir('liblib.so'))
+ self.build(supp, self.get_dir(), self.in_dir('supp.cpp'))
+ shutil.move(self.in_dir('supp.cpp.o.js'), self.in_dir('liblib.so'))
Settings.BUILD_AS_SHARED_LIB = 0
Settings.RUNTIME_LINKED_LIBS = ['liblib.so'];
@@ -9403,7 +9404,7 @@ Options that are modified or new in %s include:
self.assertContained('error: invalid preprocessing directive', output[1])
self.assertContained(["error: use of undeclared identifier 'cheez", "error: unknown type name 'cheez'"], output[1])
self.assertContained('errors generated', output[1])
- assert 'emcc: compiler frontend failed to generate LLVM bitcode, halting' in output[1].split('errors generated.')[1]
+ assert 'compiler frontend failed to generate LLVM bitcode, halting' in output[1].split('errors generated.')[1]
# emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file
# regression check: -o js should create "js", with bitcode content
@@ -9496,11 +9497,11 @@ Options that are modified or new in %s include:
assert len(output[0]) == 0, output[0]
if bc_params is not None:
if '-O1' in params and 'something.bc' in params:
- assert 'warning: -Ox flags ignored, since not generating JavaScript' in output[1]
+ assert '-Ox flags ignored, since not generating JavaScript' in output[1]
assert os.path.exists('something.bc'), output[1]
output = Popen([PYTHON, compiler, 'something.bc', '-o', 'something.js'] + bc_params, stdout=PIPE, stderr=PIPE).communicate()
assert os.path.exists('something.js'), output[1]
- assert ('Warning: Applying some potentially unsafe optimizations!' in output[1]) == (opt_level >= 3), 'unsafe warning should appear in opt >= 3'
+ assert ('Applying some potentially unsafe optimizations!' in output[1]) == (opt_level >= 3), 'unsafe warning should appear in opt >= 3'
self.assertContained('hello, world!', run_js('something.js'))
# Verify optimization level etc. in the generated code
@@ -9573,7 +9574,7 @@ Options that are modified or new in %s include:
assert not os.path.exists(target), 'We should only have created bitcode here: ' + '\n'.join(output)
# Compiling one of them alone is expected to fail
- output = Popen([PYTHON, compiler, 'twopart_main.o'] + args, stdout=PIPE, stderr=PIPE).communicate()
+ output = Popen([PYTHON, compiler, 'twopart_main.o', '-O1', '-g'] + args, stdout=PIPE, stderr=PIPE).communicate()
assert os.path.exists(target), '\n'.join(output)
#print '\n'.join(output)
self.assertContained('missing function', run_js(target, stderr=STDOUT))
@@ -9926,7 +9927,7 @@ f.close()
(['-Lsubdir/something'], False),
([], False)]:
err = Popen([PYTHON, EMCC, 'main.c'] + args, stderr=PIPE).communicate()[1]
- assert ('emcc: warning: -I or -L of an absolute path encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript)' in err) == expected, err
+ assert ('-I or -L of an absolute path encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript)' in err) == expected, err
def test_local_link(self):
# Linking a local library directly, like /usr/lib/libsomething.so, cannot work of course since it
@@ -10694,7 +10695,7 @@ seeked= file.
Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'supp.cpp'), '-o', 'supp.o']).communicate()
output = Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.o'), '-s', os.path.join(self.get_dir(), 'supp.o'), '-s', 'SAFE_HEAP=1'], stderr=PIPE).communicate()
- self.assertContained('emcc: warning: treating -s as linker option', output[1])
+ self.assertContained('treating -s as linker option', output[1])
output = run_js('a.out.js')
assert 'yello' in output, 'code works'
code = open('a.out.js').read()
@@ -13001,11 +13002,11 @@ elif 'sanity' in str(sys.argv):
if 'LLVM_ROOT' not in settings:
self.assertContained('Error in evaluating %s' % EM_CONFIG, output)
elif 'runner.py' not in ' '.join(command):
- self.assertContained('FATAL', output) # sanity check should fail
+ self.assertContained('CRITICAL', output) # sanity check should fail
def test_closure_compiler(self):
CLOSURE_FATAL = 'fatal: Closure compiler'
- CLOSURE_WARNING = 'WARNING: Closure compiler'
+ CLOSURE_WARNING = 'does not exist'
# Sanity check should find closure
restore()
@@ -13032,7 +13033,7 @@ elif 'sanity' in str(sys.argv):
assert os.path.exists('a.out.js'), output
def test_llvm(self):
- LLVM_WARNING = 'warning: LLVM version appears incorrect'
+ LLVM_WARNING = 'LLVM version appears incorrect'
restore()
@@ -13070,8 +13071,8 @@ elif 'sanity' in str(sys.argv):
del os.environ['EM_IGNORE_SANITY']
def test_node(self):
- NODE_WARNING = 'warning: node version appears too old'
- NODE_WARNING_2 = 'warning: cannot check node version'
+ NODE_WARNING = 'node version appears too old'
+ NODE_WARNING_2 = 'cannot check node version'
restore()
@@ -13193,9 +13194,9 @@ fi
try_delete(CANONICAL_TEMP_DIR)
def test_emcc_caching(self):
- INCLUDING_MESSAGE = 'emcc: including X'
- BUILDING_MESSAGE = 'emcc: building X for cache'
- ERASING_MESSAGE = 'emcc: clearing cache'
+ INCLUDING_MESSAGE = 'including X'
+ BUILDING_MESSAGE = 'building X for cache'
+ ERASING_MESSAGE = 'clearing cache'
EMCC_CACHE = Cache.dirname