aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-18 12:21:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-18 12:21:28 -0700
commita0c963f9d42663f46b6a1715de3a602bbc0ed36e (patch)
treef9b98ece4816a7fbb5974dbbba640a86b085ae55 /tests/runner.py
parentd4cfd7a6582ddef1a4e5cfe85275c0f182f067a1 (diff)
WARN_ON_UNDEFINED_SYMBOLS
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index c17b1a0a..6991735e 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6786,6 +6786,25 @@ f.close()
Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp')]).communicate()
self.assertContained('1234, 1234, 4321\n', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ def test_warn_undefined(self):
+ open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r'''
+ #include <stdio.h>
+
+ extern "C" {
+ void something();
+ }
+
+ int main() {
+ something();
+ return 0;
+ }
+ ''')
+ output = Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp'), '-s', 'WARN_ON_UNDEFINED_SYMBOLS=1'], stderr=PIPE).communicate()
+ self.assertContained('Unresolved symbol: _something\n', output[1])
+
+ output = Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp')], stderr=PIPE).communicate()
+ self.assertNotContained('Unresolved symbol: _something\n', output[1])
+
def test_prepost(self):
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write('''
#include <stdio.h>