Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/tests/test_core.py b/tests/test_core.py
- index 0cf3327..c43e5ab 100644
- --- a/tests/test_core.py
- +++ b/tests/test_core.py
- @@ -5574,6 +5574,31 @@ PORT: 3979
- self.emcc_args += ['--js-library', path_from_root('tests', 'unicode_library.js')]
- self.do_run(open(os.path.join(self.get_dir(), 'main.cpp'), 'r').read(), u'Unicode snowman \u2603 says hello!')
- + def test_js_library_features(self):
- + open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r'''
- + #include <stdio.h>
- + extern "C" {
- + extern int countey();
- + }
- + int main() {
- + printf("%d\n", countey());
- + printf("%d\n", countey());
- + printf("%d\n", countey());
- + printf("%d\n", countey());
- + printf("%d\n", countey());
- + return 0;
- + }
- + ''')
- + open(os.path.join(self.get_dir(), 'mylib.js'), 'w').write('''
- + mergeInto(LibraryManager.library, {
- + // code provided in a string is emitted directly; this lets us do a closure in a simple way
- + countey: '(function() { var counter = 0; return function() { return counter++ }; })()',
- + });
- + ''')
- +
- + self.emcc_args += ['--js-library', os.path.join(self.get_dir(), 'mylib.js')]
- + self.do_run(open(os.path.join(self.get_dir(), 'main.cpp'), 'r').read(), '0\n1\n2\n3\n4\n')
- +
- def test_constglobalunion(self):
- self.emcc_args += ['-s', 'EXPORT_ALL=1']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement