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

Method test_dlfcn_basic

test/test_core.py:2946–2983  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

2944 'pthreads': (['-pthread', '-sEXIT_RUNTIME', '-sPROXY_TO_PTHREAD', '-Wno-experimental'],),
2945 })
2946 def test_dlfcn_basic(self, args):
2947 if args:
2948 self.require_pthreads()
2949 self.cflags += args
2950 create_file('libside.cpp', '''
2951 #include <cstdio>
2952
2953 class Foo {
2954 public:
2955 Foo() {
2956 puts("Constructing lib object.");
2957 }
2958 };
2959
2960 Foo side_global;
2961 ''&#x27;)
2962 self.build_dlfcn_lib('libside.cpp')
2963
2964 self.prep_dlfcn_main()
2965 src = ''&#x27;
2966 #include <cstdio>
2967 #include <dlfcn.h>
2968
2969 class Bar {
2970 public:
2971 Bar() {
2972 puts("Constructing main object.");
2973 }
2974 };
2975
2976 Bar global;
2977
2978 int main() {
2979 dlopen("libside.so", RTLD_NOW);
2980 return 0;
2981 }
2982 ''&#x27;
2983 self.do_run(src, 'Constructing main object.\nConstructing lib object.\n')
2984
2985 @needs_dylink
2986 def test_dlfcn_i64(self):

Callers

nothing calls this directly

Calls 5

build_dlfcn_libMethod · 0.95
prep_dlfcn_mainMethod · 0.95
do_runMethod · 0.95
create_fileFunction · 0.90
require_pthreadsMethod · 0.80

Tested by

no test coverage detected