Skip to content

Commit 43a3b9a

Browse files
committed
tests: isolate cleanup tests
1 parent 006dcb5 commit 43a3b9a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ jobs:
8282
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
8383
PYTHONQT_RUN_ONLY_MEMORY_TESTS=1 \
8484
make check TESTARGS="-platform minimal"
85+
86+
- name: Run cleanup tests with sanitizers
87+
run: |
88+
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
89+
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
90+
PYTHONQT_RUN_ONLY_CLEANUP_TESTS=1 \
91+
make check TESTARGS="-platform minimal"
8592
8693
- name: Generate Wrappers
8794
run: |

tests/PythonQtTestMain.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ int main( int argc, char **argv )
5555
return 0;
5656
}
5757

58+
if (QProcessEnvironment::systemEnvironment().contains("PYTHONQT_RUN_ONLY_CLEANUP_TESTS")) {
59+
PythonQtTestCleanup cleanup;
60+
QTest::qExec(&cleanup, argc, argv);
61+
return 0;
62+
}
63+
5864
PythonQt::init(PythonQt::IgnoreSiteModule | PythonQt::RedirectStdOut);
5965
int failCount = 0;
6066
PythonQtTestApi api;
@@ -70,9 +76,6 @@ int main( int argc, char **argv )
7076
Py_Finalize();
7177
}
7278

73-
PythonQtTestCleanup cleanup;
74-
failCount += QTest::qExec(&cleanup, argc, argv);
75-
7679
if (failCount) {
7780
std::cerr << "Tests failed: " << failCount << std::endl;
7881
} else {

0 commit comments

Comments
 (0)