diff options
Diffstat (limited to 'smoketest/libtest.cxx')
-rw-r--r-- | smoketest/libtest.cxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx index 29959b07654d..98607fbd9609 100644 --- a/smoketest/libtest.cxx +++ b/smoketest/libtest.cxx @@ -82,7 +82,29 @@ int main (int argc, char **argv) return 1; // coverity[tainted_string] - build time test tool - Office *pOffice = lok_cpp_init( argv[1] ); + char *install_path = argv[1]; + + if( argc > 4 ) + { + fprintf( stderr, "testing preinit\n"); + char *imp_lib; + void *dlhandle; + dlhandle = lok_dlopen( install_path, &imp_lib ); + if( !dlhandle ) + { + fprintf( stderr, "Failed to link '%s'\n", lok_dlerror() ); + return -1; + } + LokHookPreInit *preinit = (LokHookPreInit *) lok_dlsym( dlhandle, "lok_preinit" ); + if( !preinit ) + { + fprintf( stderr, "Failed to find pre-init symbol: %s\n", lok_dlerror() ); + return -1; + } + preinit( install_path, NULL ); + } + + Office *pOffice = lok_cpp_init( install_path ); if( !pOffice ) { fprintf( stderr, "Failed to initialize\n" ); |