def test_js_libraries(self):
    create_test_file('main.cpp', '\n      #include <stdio.h>\n      extern "C" {\n        extern void printey();\n        extern int calcey(int x, int y);\n      }\n      int main() {\n        printey();\n        printf("*%d*\\n", calcey(10, 22));\n        return 0;\n      }\n    ')
    create_test_file('mylib1.js', "\n      mergeInto(LibraryManager.library, {\n        printey: function() {\n          out('hello from lib!');\n        }\n      });\n    ")
    create_test_file('mylib2.js', '\n      mergeInto(LibraryManager.library, {\n        calcey: function(x, y) {\n          return x + y;\n        }\n      });\n    ')
    self.emcc_args += ['--js-library', 'mylib1.js', '--js-library', 'mylib2.js']
    self.do_run(open('main.cpp').read(), 'hello from lib!\n*32*\n')
def test_js_libraries(self):
    create_test_file('main.cpp', '\n      #include <stdio.h>\n      extern "C" {\n        extern void printey();\n        extern int calcey(int x, int y);\n      }\n      int main() {\n        printey();\n        printf("*%d*\\n", calcey(10, 22));\n        return 0;\n      }\n    ')
    create_test_file('mylib1.js', "\n      mergeInto(LibraryManager.library, {\n        printey: function() {\n          out('hello from lib!');\n        }\n      });\n    ")
    create_test_file('mylib2.js', '\n      mergeInto(LibraryManager.library, {\n        calcey: function(x, y) {\n          return x + y;\n        }\n      });\n    ')
    self.emcc_args += ['--js-library', 'mylib1.js', '--js-library', 'mylib2.js']
    self.do_run(open('main.cpp').read(), 'hello from lib!\n*32*\n')