def test(syslibs, expect_pass=True, need_reverse=True):
    print('syslibs', syslibs, self.get_setting('ASSERTIONS'))
    passed = True
    try:
        with env_modify({'EMCC_FORCE_STDLIBS': syslibs}):
            self.dylink_test(main='\n            void side();\n            int main() {\n              side();\n              return 0;\n            }\n          ', side='\n            #include <iostream>\n            void side() { std::cout << "cout hello from side\\n"; }\n          ', expected=['cout hello from side\n'], need_reverse=need_reverse, assert_returncode=None)
    except Exception as e:
        if expect_pass:
            raise
        print('(seeing expected fail)')
        passed = False
        assertion = 'build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment'
        if self.get_setting('ASSERTIONS'):
            self.assertContained(assertion, str(e))
        else:
            self.assertNotContained(assertion, str(e))
    assert (passed == expect_pass), ['saw', passed, 'but expected', expect_pass]
def test(syslibs, expect_pass=True, need_reverse=True):
    print('syslibs', syslibs, self.get_setting('ASSERTIONS'))
    passed = True
    try:
        with env_modify({'EMCC_FORCE_STDLIBS': syslibs}):
            self.dylink_test(main='\n            void side();\n            int main() {\n              side();\n              return 0;\n            }\n          ', side='\n            #include <iostream>\n            void side() { std::cout << "cout hello from side\\n"; }\n          ', expected=['cout hello from side\n'], need_reverse=need_reverse, assert_returncode=None)
    except Exception as e:
        if expect_pass:
            raise
        print('(seeing expected fail)')
        passed = False
        assertion = 'build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment'
        if self.get_setting('ASSERTIONS'):
            self.assertContained(assertion, str(e))
        else:
            self.assertNotContained(assertion, str(e))
    assert (passed == expect_pass), ['saw', passed, 'but expected', expect_pass]