MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / test_dlfcn_missing

Method test_dlfcn_missing

test/test_core.py:2919–2939  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2917 @needs_dylink
2918 @no_js_math('JS_MATH is not compatible with MAIN_MODULE=1')
2919 def test_dlfcn_missing(self):
2920 self.set_setting('MAIN_MODULE')
2921 self.set_setting('ASSERTIONS')
2922 src = r'''
2923 #include <dlfcn.h>
2924 #include <stdio.h>
2925 #include <assert.h>
2926
2927 int main() {
2928 void* lib_handle = dlopen("libfoo.so", RTLD_NOW);
2929 assert(!lib_handle);
2930 printf("error: %s\n", dlerror());
2931 return 0;
2932 }
2933 ''&#x27;
2934
2935 if self.get_current_js_engine() == config.V8_ENGINE:
2936 expected = "error: could not load dynamic lib: libfoo.so\nError: Error reading file"
2937 else:
2938 expected = "error: could not load dynamic lib: libfoo.so\nError: ENOENT: no such file or directory"
2939 self.do_run(src, expected)
2940
2941 @needs_dylink
2942 @parameterized({

Callers

nothing calls this directly

Calls 3

do_runMethod · 0.95
set_settingMethod · 0.80
get_current_js_engineMethod · 0.80

Tested by

no test coverage detected