Created
June 17, 2013 01:41
-
-
Save kripken/5794193 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/runner.py b/tests/runner.py | |
index 73dbab1..dc3f721 100755 | |
--- a/tests/runner.py | |
+++ b/tests/runner.py | |
@@ -9009,6 +9009,32 @@ def process(filename): | |
''' | |
self.do_run(src, 'abs(-10): 10\nabs(-11): 11'); | |
+ def test_embind2jslib(self): | |
+ if self.emcc_args is None: return self.skip('requires emcc') | |
+ Building.COMPILER_TEST_OPTS += ['--bind', '--js-library', 'lib.js'] | |
+ | |
+ open('lib.js', 'w').write(''' | |
+ mergeInto(LibraryManager.library, { | |
+ c_func: function() { Module.print('hello embind, i am a js lib') } | |
+ }); | |
+ ''') | |
+ | |
+ src = r''' | |
+ #include<stdio.h> | |
+ #include<emscripten/val.h> | |
+ | |
+ using namespace emscripten; | |
+ | |
+ extern "C" { void c_func(); } | |
+ | |
+ int main() { | |
+ val the_c_func = val::fromJS(c_func); | |
+ the_c_func(); | |
+ return 0; | |
+ } | |
+ ''' | |
+ self.do_run(src, 'hello embind, i am a js lib'); | |
+ | |
def test_scriptaclass(self): | |
if self.emcc_args is None: return self.skip('requires emcc') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment