diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/calls.cpp | 7 | ||||
-rw-r--r-- | test/calls.post.js | 7 | ||||
-rw-r--r-- | test/calls.txt | 6 |
3 files changed, 18 insertions, 2 deletions
diff --git a/test/calls.cpp b/test/calls.cpp index b73dff3f4..0afb0eb69 100644 --- a/test/calls.cpp +++ b/test/calls.cpp @@ -1,5 +1,3 @@ -#include <cmath> -#include <algorithm> #include <emscripten.h> extern "C" { @@ -17,5 +15,10 @@ int EMSCRIPTEN_KEEPALIVE fibo(int x) { return fibo(x-1) + fibo(x-2); } +int EMSCRIPTEN_KEEPALIVE run_script() { + emscripten_run_script("Module.print('hello from called script')"); + return emscripten_run_script_int("1+2+3+4-1"); +} + } diff --git a/test/calls.post.js b/test/calls.post.js index f2b422ed2..bec4d498b 100644 --- a/test/calls.post.js +++ b/test/calls.post.js @@ -14,3 +14,10 @@ function test(name) { test('simple'); test('fibo'); +Module.print('run_script'); +Module.print(Module['_run_script']()); + +Module.print('too many/few arguments'); +Module.print(Module['_simple']()); +Module.print(Module['_simple'](10, 20)); + diff --git a/test/calls.txt b/test/calls.txt index 7d1b8ee47..6a175ed04 100644 --- a/test/calls.txt +++ b/test/calls.txt @@ -10,3 +10,9 @@ fibo 3 ==> 3 4 ==> 5 7 ==> 21 +run_script +hello from called script +9 +too many/few arguments +2 +102 |