diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-13 21:41:45 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-13 21:41:45 -0800 |
commit | 03d51f9684f6f7007751a94d0900030df701bae2 (patch) | |
tree | e33281f749cf11e4c70d68d973d269290b81f552 | |
parent | 3a454ac8976123fb753ac7f2fd4640c01daeec2b (diff) |
test for multiple undefined symbols
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | tests/test_other.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index a9505bb8..fca80a53 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -497,7 +497,7 @@ function JSify(data, functionsOnly, givenFunctions) { } if (!LINKABLE && !LibraryManager.library.hasOwnProperty(shortident) && !LibraryManager.library.hasOwnProperty(shortident + '__inline')) { if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + shortident); - if (VERBOSE || WARN_ON_UNDEFINED_SYMBOLS) printErr('warning: unresolved symbol: ' + shortident); + if (VERBOSE || WARN_ON_UNDEFINED_SYMBOLS) warn('unresolved symbol: ' + shortident); if (ASM_JS) { // emit a stub that will fail during runtime. this allows asm validation to succeed. LibraryManager.library[shortident] = new Function("Module['printErr']('missing function: " + shortident + "'); abort(-1);"); diff --git a/tests/test_other.py b/tests/test_other.py index ba4ed0ba..c1621e63 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1444,10 +1444,12 @@ f.close() extern "C" { void something(); + void elsey(); } int main() { something(); + elsey(); return 0; } ''') @@ -1463,9 +1465,11 @@ f.close() output = Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp')] + extra + args, stderr=PIPE).communicate() if action == None or (action == 'WARN' and value): self.assertContained('unresolved symbol: something', output[1]) + self.assertContained('unresolved symbol: elsey', output[1]) assert os.path.exists('a.out.js') elif action == 'ERROR' and value: self.assertContained('unresolved symbol: something', output[1]) + self.assertContained('unresolved symbol: elsey', output[1]) assert not os.path.exists('a.out.js') elif action == 'WARN' and not value: self.assertNotContained('unresolved symbol', output[1]) |