mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix build problem on Qt5 in relation to unit tests.
This commit is contained in:
@@ -1296,16 +1296,29 @@ int RiaApplication::launchUnitTests()
|
|||||||
#ifdef USE_UNIT_TESTS
|
#ifdef USE_UNIT_TESTS
|
||||||
cvf::Assert::setReportMode(cvf::Assert::CONSOLE);
|
cvf::Assert::setReportMode(cvf::Assert::CONSOLE);
|
||||||
|
|
||||||
int argc = QCoreApplication::argc();
|
int argc = QCoreApplication::arguments().size();
|
||||||
testing::InitGoogleTest(&argc, QCoreApplication::argv());
|
QStringList arguments = QCoreApplication::arguments();
|
||||||
|
std::vector<std::string> argumentsStd;
|
||||||
|
for (QString qstring : arguments)
|
||||||
|
{
|
||||||
|
argumentsStd.push_back(qstring.toStdString());
|
||||||
|
}
|
||||||
|
std::vector<char*> argv;
|
||||||
|
for (std::string& string : argumentsStd)
|
||||||
|
{
|
||||||
|
argv.push_back(&string.front());
|
||||||
|
}
|
||||||
|
|
||||||
|
testing::InitGoogleTest(&argc, argv.data());
|
||||||
|
|
||||||
// Use this macro in main() to run all tests. It returns 0 if all
|
// Use this macro in main() to run all tests. It returns 0 if all
|
||||||
// tests are successful, or 1 otherwise.
|
// tests are successful, or 1 otherwise.
|
||||||
//
|
//
|
||||||
// RUN_ALL_TESTS() should be invoked after the command line has been
|
// RUN_ALL_TESTS() should be invoked after the command line has been
|
||||||
// parsed by InitGoogleTest().
|
// parsed by InitGoogleTest().
|
||||||
|
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user