Skip to content
Snippets Groups Projects
Unverified Commit 0b9ed244 authored by Pospelov, Gennady's avatar Pospelov, Gennady Committed by GitHub
Browse files

Merge pull request #725 from waltervh/develop

Exclude performance test from functional test suite and remove limit …
parents 97381421 aedbdfbf
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,10 @@ set(test_cases ...@@ -17,8 +17,10 @@ set(test_cases
RoughnessTranslation RoughnessTranslation
TwoLayerRoughnessTranslation TwoLayerRoughnessTranslation
SaveLoadProject SaveLoadProject
CsvImportAssistantPerformanceTest # Performance tests are not part of the functional test suite.
# GUIPerformanceTest # too heavy, call manually when necessary # They need to be run manually when needed.
# CsvImportAssistantPerformanceTest
# GUIPerformanceTest
) )
file(GLOB source_files "*.cpp") file(GLOB source_files "*.cpp")
......
...@@ -17,17 +17,12 @@ ...@@ -17,17 +17,12 @@
#include "CsvImportAssistant.h" #include "CsvImportAssistant.h"
#include "OutputDataReadFactory.h" #include "OutputDataReadFactory.h"
#include "OutputDataWriteFactory.h" #include "OutputDataWriteFactory.h"
//#include <QDebug>
#include <iostream>
#include <ctime> #include <ctime>
#include <iostream>
CsvImportAssistantPerformanceTest::CsvImportAssistantPerformanceTest() CsvImportAssistantPerformanceTest::CsvImportAssistantPerformanceTest() {}
{
}
CsvImportAssistantPerformanceTest::~CsvImportAssistantPerformanceTest() CsvImportAssistantPerformanceTest::~CsvImportAssistantPerformanceTest() {}
{
}
void CsvImportAssistantPerformanceTest::writeTestFile() void CsvImportAssistantPerformanceTest::writeTestFile()
{ {
...@@ -63,8 +58,6 @@ bool CsvImportAssistantPerformanceTest::runTest() ...@@ -63,8 +58,6 @@ bool CsvImportAssistantPerformanceTest::runTest()
std::cout << "CsvImportAssistantPerformanceTest -> Running ..." << std::endl; std::cout << "CsvImportAssistantPerformanceTest -> Running ..." << std::endl;
size_t maxRows = 1000; size_t maxRows = 1000;
size_t maxCols = 1000; size_t maxCols = 1000;
double_t millisec_tolerance = 2000.0;
bool isTimeShort = true;
for (size_t nRows = 10; nRows <= maxRows; nRows *= 10) { for (size_t nRows = 10; nRows <= maxRows; nRows *= 10) {
for (size_t nCols = 10; nCols <= maxCols; nCols *= 10) { for (size_t nCols = 10; nCols <= maxCols; nCols *= 10) {
...@@ -90,18 +83,13 @@ bool CsvImportAssistantPerformanceTest::runTest() ...@@ -90,18 +83,13 @@ bool CsvImportAssistantPerformanceTest::runTest()
if (RawDataVec.size() != nRows) if (RawDataVec.size() != nRows)
return false; return false;
// The test fails if the time was not short: // Report on the test time:
std::clock_t c_end = std::clock(); std::clock_t c_end = std::clock();
double_t time_spent = 1000.0 * double_t(c_end - c_start) / double_t(CLOCKS_PER_SEC); double_t time_spent = 1000.0 * double_t(c_end - c_start) / double_t(CLOCKS_PER_SEC);
isTimeShort = millisec_tolerance - time_spent > 0;
std::cout << "nRows: " << nRows << "; nCols: " << nCols << "; time: " << time_spent std::cout << "nRows: " << nRows << "; nCols: " << nCols << "; time: " << time_spent
<< " ms\n" << " ms\n"
<< std::flush; << std::flush;
if (!isTimeShort)
break;
} }
if (!isTimeShort)
break;
} }
return isTimeShort; return true;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment