mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
ts: test tags for flexible/reliable tests filtering
- added functionality to collect memory usage of OpenCL sybsystem - memory usage of fastMalloc() (disabled by default): * It is not accurate sometimes - external memory profiler is required. - specify common `CV_TEST_TAG_` macros - added applyTestTag() function - write memory usage / enabled tags into Google Tests output file (.xml)
This commit is contained in:
committed by
Alexander Alekhin
parent
dad2247b56
commit
b38de57f9a
@@ -1,5 +1,7 @@
|
||||
#include "precomp.hpp"
|
||||
|
||||
#include "ts_tags.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
@@ -999,6 +1001,8 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
||||
"{ perf_cuda_info_only |false |print an information about system and an available CUDA devices and then exit.}"
|
||||
#endif
|
||||
"{ skip_unstable |false |skip unstable tests }"
|
||||
|
||||
CV_TEST_TAGS_PARAMS
|
||||
;
|
||||
|
||||
cv::CommandLineParser args(argc, argv, command_line_keys);
|
||||
@@ -1145,6 +1149,8 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
||||
::testing::AddGlobalTestEnvironment(new PerfValidationEnvironment());
|
||||
}
|
||||
|
||||
activateTestTags(args);
|
||||
|
||||
if (!args.check())
|
||||
{
|
||||
args.printErrors();
|
||||
@@ -1869,14 +1875,15 @@ void TestBase::SetUp()
|
||||
currentIter = (unsigned int)-1;
|
||||
timeLimit = timeLimitDefault;
|
||||
times.clear();
|
||||
metrics.terminationReason = performance_metrics::TERM_SKIP_TEST;
|
||||
}
|
||||
|
||||
void TestBase::TearDown()
|
||||
{
|
||||
if (metrics.terminationReason == performance_metrics::TERM_SKIP_TEST)
|
||||
{
|
||||
LOGI("\tTest was skipped");
|
||||
GTEST_SUCCEED() << "Test was skipped";
|
||||
//LOGI("\tTest was skipped");
|
||||
//GTEST_SUCCEED() << "Test was skipped";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1975,6 +1982,7 @@ std::string TestBase::getDataPath(const std::string& relativePath)
|
||||
|
||||
void TestBase::RunPerfTestBody()
|
||||
{
|
||||
metrics.clear();
|
||||
try
|
||||
{
|
||||
#ifdef CV_COLLECT_IMPL_DATA
|
||||
@@ -1990,7 +1998,7 @@ void TestBase::RunPerfTestBody()
|
||||
catch(const SkipTestException&)
|
||||
{
|
||||
metrics.terminationReason = performance_metrics::TERM_SKIP_TEST;
|
||||
return;
|
||||
throw;
|
||||
}
|
||||
catch(const PerfSkipTestException&)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user