File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 99#define MY_EXPORT
1010#endif
1111
12+ #define RUN_TEST_IN_STATIC_INITIALIZER
13+
1214extern " C"
1315{
1416
@@ -17,7 +19,7 @@ extern "C"
1719 return 42 ;
1820 }
1921
20- int MY_EXPORT run_pythonqt_tests (int argc, char * argv[])
22+ int _run_pythonqt_tests (int argc, char * argv[])
2123 {
2224 // Copied from PythonQtTestMain.cpp
2325 int failCount = 0 ;
@@ -37,6 +39,18 @@ extern "C"
3739 return failCount;
3840 }
3941
42+
43+ int MY_EXPORT run_pythonqt_tests (int argc, char * argv[])
44+ {
45+ #ifndef RUN_TEST_IN_STATIC_INITIALIZER
46+ return _run_pythonqt_tests (argc, argv);
47+ #else
48+ Q_UNUSED (argc);
49+ Q_UNUSED (argv);
50+ return 0 ;
51+ #endif
52+ }
53+
4054}
4155
4256struct StaticInitializer
@@ -45,6 +59,12 @@ struct StaticInitializer
4559 {
4660 std::cout << " PythonQtDynamicLoaderSharedLibrary::StaticInitializer" << std::endl;
4761 PythonQt::init (PythonQt::IgnoreSiteModule | PythonQt::RedirectStdOut);
62+
63+ #ifdef RUN_TEST_IN_STATIC_INITIALIZER
64+ int argc = 1 ;
65+ char * argv [] = {" RunTestInStaticInitializer" };
66+ _run_pythonqt_tests (argc, argv);
67+ #endif
4868 }
4969};
5070
You can’t perform that action at this time.
0 commit comments