@needs_dlfcn
def test_dlfcn_missing(self):
    self.set_setting('MAIN_MODULE', 1)
    if self.has_changed_setting('ASSERTIONS'):
        self.skipTest('test needs to customize ASSERTIONS')
    self.set_setting('ASSERTIONS', 1)
    src = '\n      #include <dlfcn.h>\n      #include <stdio.h>\n      #include <assert.h>\n\n      int main() {\n        void* lib_handle = dlopen("libfoo.so", RTLD_NOW);\n        assert(!lib_handle);\n        printf("error: %s\\n", dlerror());\n        return 0;\n      }\n      '
    self.do_run(src, 'error: Could not load dynamic lib: libfoo.so\nError: No such file or directory')
    print('without assertions, the error is less clear')
    self.set_setting('ASSERTIONS', 0)
    self.do_run(src, 'error: Could not load dynamic lib: libfoo.so\nError: FS error')
@needs_dlfcn
def test_dlfcn_missing(self):
    self.set_setting('MAIN_MODULE', 1)
    if self.has_changed_setting('ASSERTIONS'):
        self.skipTest('test needs to customize ASSERTIONS')
    self.set_setting('ASSERTIONS', 1)
    src = '\n      #include <dlfcn.h>\n      #include <stdio.h>\n      #include <assert.h>\n\n      int main() {\n        void* lib_handle = dlopen("libfoo.so", RTLD_NOW);\n        assert(!lib_handle);\n        printf("error: %s\\n", dlerror());\n        return 0;\n      }\n      '
    self.do_run(src, 'error: Could not load dynamic lib: libfoo.so\nError: No such file or directory')
    print('without assertions, the error is less clear')
    self.set_setting('ASSERTIONS', 0)
    self.do_run(src, 'error: Could not load dynamic lib: libfoo.so\nError: FS error')