Skip to content
Snippets Groups Projects
Commit 3e70c460 authored by Soeren Peters's avatar Soeren Peters
Browse files

The numerical test executable is now returning false in case one or more tests failed.

parent 9ddc0926
No related branches found
No related tags found
1 merge request!3Add manual numerical gpu test and enable the sonar-scanner again.
......@@ -5,5 +5,6 @@ class TestQueue
{
public:
virtual void makeFinalOutput() = 0;
virtual int getNumberOfFailedTests() const noexcept = 0;
};
#endif
\ No newline at end of file
......@@ -12,6 +12,8 @@ void TestQueueImp::makeFinalOutput()
colorOutput->makeFinalTestOutputFoot(numberOfTests, numberOfExecutedTest, numberOfPassedTest, numberOfFailedTest, numberOfErrorTest, numberOfNotExecutedTest);
}
int TestQueueImp::getNumberOfFailedTests() const noexcept { return numberOfFailedTest; }
std::shared_ptr<TestQueueImp> TestQueueImp::getNewInstance(std::shared_ptr<ColorConsoleOutput> colorOutput)
{
return std::shared_ptr<TestQueueImp>(new TestQueueImp(colorOutput));
......
......@@ -14,6 +14,8 @@ class TestQueueImp : public TestQueue
public:
void makeFinalOutput();
int getNumberOfFailedTests() const noexcept override;
static std::shared_ptr<TestQueueImp> getNewInstance(std::shared_ptr<ColorConsoleOutput> colorOutput);
void addTest(std::shared_ptr<Test> test);
......
......@@ -101,7 +101,7 @@ static void validateTestSuite()
}
static void startNumericalTests(const std::string &configFile)
static bool startNumericalTests(const std::string &configFile)
{
std::shared_ptr<ConfigFileReader> configReader = ConfigFileReader::getNewInstance(configFile);
configReader->readConfigFile();
......@@ -120,6 +120,8 @@ static void startNumericalTests(const std::string &configFile)
testQueue->makeFinalOutput();
logFileQueue->writeLogFiles();
return testQueue->getNumberOfFailedTests() > 0;
}
int main(int argc, char **argv)
......@@ -128,12 +130,14 @@ int main(int argc, char **argv)
//validateTestSuite();
bool tests_passed{false};
if (argc > 1)
startNumericalTests(argv[1]);
tests_passed = startNumericalTests(argv[1]);
else
std::cout << "Configuration file must be set!: lbmgm <config file>" << std::endl << std::flush;
MPI_Finalize();
return 0;
return tests_passed;
}
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