diff options
-rw-r--r-- | src/shell.js | 1 | ||||
-rwxr-xr-x | tests/runner.py | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/shell.js b/src/shell.js index c8f3644a..20db25a7 100644 --- a/src/shell.js +++ b/src/shell.js @@ -1,5 +1,6 @@ try { this['Module'] = Module; + Module.test; } catch(e) { this['Module'] = Module = {}; } diff --git a/tests/runner.py b/tests/runner.py index 335d7d4b..c717e021 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8681,6 +8681,24 @@ def process(filename): Settings.ALIASING_FUNCTION_POINTERS = 1 - Settings.ALIASING_FUNCTION_POINTERS # flip the test self.do_run(src, '''Hello 7 from JS!''') + def test_embind(self): + if self.emcc_args is None: return self.skip('requires emcc') + Building.COMPILER_TEST_OPTS += ['--bind'] + + src = r''' + #include<stdio.h> + #include<emscripten/val.h> + + using namespace emscripten; + + int main() { + val Math = val::global("Math"); + printf("abs(-10): %d\n", Math.call<int>("abs", -10)); + return 0; + } + ''' + self.do_run(src, 'abs(-10): 10'); + def test_scriptaclass(self): if self.emcc_args is None: return self.skip('requires emcc') |