File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 9
9
#define MY_EXPORT
10
10
#endif
11
11
12
+ #define RUN_TEST_IN_STATIC_INITIALIZER
13
+
12
14
extern " C"
13
15
{
14
16
@@ -17,7 +19,7 @@ extern "C"
17
19
return 42 ;
18
20
}
19
21
20
- int MY_EXPORT run_pythonqt_tests (int argc, char * argv[])
22
+ int _run_pythonqt_tests (int argc, char * argv[])
21
23
{
22
24
// Copied from PythonQtTestMain.cpp
23
25
int failCount = 0 ;
@@ -37,6 +39,18 @@ extern "C"
37
39
return failCount;
38
40
}
39
41
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
+
40
54
}
41
55
42
56
struct StaticInitializer
@@ -45,6 +59,12 @@ struct StaticInitializer
45
59
{
46
60
std::cout << " PythonQtDynamicLoaderSharedLibrary::StaticInitializer" << std::endl;
47
61
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
48
68
}
49
69
};
50
70
You can’t perform that action at this time.
0 commit comments