Skip to content
Snippets Groups Projects
Commit 5ec0c911 authored by Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin Committed by Matthew Woehlke
Browse files

Fix compilation of test when PythonQt_Wrap_Qtcore option is disabled

This commit fixes the following link error:

PythonQtTestMain.cpp:(.text+0x1637): undefined reference to `PythonQtTestCleanup::~PythonQtTestCleanup()'
parent 5a29ac6d
No related branches found
No related tags found
No related merge requests found
......@@ -270,6 +270,8 @@ if(BUILD_TESTING)
tests/PythonQtTestMain.cpp
)
set_property(SOURCE tests/PythonQtTestMain.cpp PROPERTY COMPILE_DEFINITIONS "main=tests_PythonQtTestMain")
list(APPEND test_sources
tests/PythonQtTests.cpp
tests/PythonQtTests.h
......@@ -289,9 +291,9 @@ if(BUILD_TESTING)
QT4_WRAP_CPP(test_sources
tests/PythonQtTestCleanup.h
)
endif()
set_property(SOURCE tests/PythonQtTestMain.cpp PROPERTY COMPILE_DEFINITIONS "main=tests_PythonQtTestMain")
set_property(SOURCE tests/PythonQtTestMain.cpp APPEND PROPERTY COMPILE_DEFINITIONS "PythonQt_Wrap_Qtcore")
endif()
add_executable(PythonQtCppTests ${test_sources})
target_link_libraries(PythonQtCppTests PythonQt)
......
......@@ -65,6 +65,7 @@ int main(int argc, char *argv[])
Py_Finalize();
}
#ifdef PythonQt_Wrap_Qtcore
PythonQtTestCleanup cleanup;
failCount += QTest::qExec(&cleanup, argc, argv);
......@@ -73,6 +74,8 @@ int main(int argc, char *argv[])
} else {
std::cout << "All tests passed successfully." << std::endl;
}
#endif
return failCount;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment