diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-05-23 18:25:54 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-05-23 18:25:54 -0700 |
commit | 2f8ca9a8c98cd77c57a5fff49874f64f67a1df55 (patch) | |
tree | b633a61ccb611a89133b9f773c14cd75094f93a2 /tests | |
parent | 41ea37201c7b0c2aaec8631a09c7754b36a83d4c (diff) |
properly expand response files in EXPORTED_FUNCTIONS, which is used before compiler.js
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index a6b90f8d..335d7d4b 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8620,6 +8620,28 @@ def process(filename): shutil.move(self.in_dir('src.cpp.o.js'), self.in_dir('pgoed2.js')) assert open('pgoed.js').read() == open('pgoed2.js').read() + def test_exported_response(self): + if self.emcc_args is None: return self.skip('requires emcc') + + src = r''' + #include <stdio.h> + #include <stdlib.h> + + extern "C" { + int other_function() { return 5; } + } + + int main() { + printf("waka!\n"); + return 0; + } + ''' + open('exps', 'w').write('["_main","_other_function"]') + + self.emcc_args += ['-s', 'EXPORTED_FUNCTIONS=@exps'] + self.do_run(src, '''waka!''') + assert 'other_function' in open('src.cpp.o.js').read() + def test_add_function(self): if self.emcc_args is None: return self.skip('requires emcc') |