def test_memprof_requirements(self):
    create_test_file('main.cpp', '\n      extern "C" {\n        void check_memprof_requirements();\n      }\n      int main() {\n        check_memprof_requirements();\n        return 0;\n      }\n    ')
    create_test_file('lib.js', "\n      mergeInto(LibraryManager.library, {\n        check_memprof_requirements: function() {\n          if (typeof STATIC_BASE === 'number' &&\n              typeof STACK_BASE === 'number' &&\n              typeof STACK_MAX === 'number' &&\n              typeof STACKTOP === 'number' &&\n              typeof DYNAMIC_BASE === 'number' &&\n              typeof DYNAMICTOP_PTR === 'number') {\n             out('able to run memprof');\n           } else {\n             out('missing the required variables to run memprof');\n           }\n        }\n      });\n    ")
    self.emcc_args += ['--js-library', 'lib.js']
    self.do_run(open('main.cpp').read(), 'able to run memprof')
def test_memprof_requirements(self):
    create_test_file('main.cpp', '\n      extern "C" {\n        void check_memprof_requirements();\n      }\n      int main() {\n        check_memprof_requirements();\n        return 0;\n      }\n    ')
    create_test_file('lib.js', "\n      mergeInto(LibraryManager.library, {\n        check_memprof_requirements: function() {\n          if (typeof STATIC_BASE === 'number' &&\n              typeof STACK_BASE === 'number' &&\n              typeof STACK_MAX === 'number' &&\n              typeof STACKTOP === 'number' &&\n              typeof DYNAMIC_BASE === 'number' &&\n              typeof DYNAMICTOP_PTR === 'number') {\n             out('able to run memprof');\n           } else {\n             out('missing the required variables to run memprof');\n           }\n        }\n      });\n    ")
    self.emcc_args += ['--js-library', 'lib.js']
    self.do_run(open('main.cpp').read(), 'able to run memprof')