1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

ts: test case list is printed after cmd line parsing, refactored

This commit is contained in:
Maksim Shabunin
2018-07-26 16:27:47 +03:00
parent fa466b022d
commit 597db69151
8 changed files with 136 additions and 209 deletions
+9 -19
View File
@@ -379,10 +379,9 @@ struct TSParams
class TS
{
public:
// constructor(s) and destructor
TS();
virtual ~TS();
public:
enum
{
@@ -484,9 +483,6 @@ public:
SKIPPED=1
};
// get file storage
CvFileStorage* get_file_storage();
// get RNG to generate random input data for a test
RNG& get_rng() { return rng; }
@@ -629,9 +625,6 @@ struct DefaultRngAuto
void fillGradient(Mat& img, int delta = 5);
void smoothBorder(Mat& img, const Scalar& color, int delta = 3);
void printVersionInfo(bool useStdOut = true);
// Utility functions
void addDataSearchPath(const std::string& path);
@@ -660,6 +653,13 @@ std::string findDataFile(const std::string& relative_path, bool required = true)
*/
std::string findDataDirectory(const std::string& relative_path, bool required = true);
// Test definitions
class SystemInfoCollector : public testing::EmptyTestEventListener
{
private:
virtual void OnTestProgramStart(const testing::UnitTest&);
};
#ifndef __CV_TEST_EXEC_ARGS
#if defined(_MSC_VER) && (_MSC_VER <= 1400)
@@ -671,15 +671,6 @@ std::string findDataDirectory(const std::string& relative_path, bool required =
#endif
#endif
#ifdef HAVE_OPENCL
namespace ocl {
void dumpOpenCLDevice();
}
#define TEST_DUMP_OCL_INFO cvtest::ocl::dumpOpenCLDevice();
#else
#define TEST_DUMP_OCL_INFO
#endif
void parseCustomOptions(int argc, char **argv);
#define CV_TEST_INIT0_NOOP (void)0
@@ -696,8 +687,7 @@ int main(int argc, char **argv) \
ts->init(resourcesubdir); \
__CV_TEST_EXEC_ARGS(CV_TEST_INIT0_ ## INIT0) \
::testing::InitGoogleTest(&argc, argv); \
cvtest::printVersionInfo(); \
TEST_DUMP_OCL_INFO \
::testing::UnitTest::GetInstance()->listeners().Append(new SystemInfoCollector); \
__CV_TEST_EXEC_ARGS(__VA_ARGS__) \
parseCustomOptions(argc, argv); \
} \
+1 -11
View File
@@ -637,15 +637,6 @@ void PrintTo(const Size& sz, ::std::ostream* os);
#endif
#endif
#ifdef HAVE_OPENCL
namespace cvtest { namespace ocl {
void dumpOpenCLDevice();
}}
#define TEST_DUMP_OCL_INFO cvtest::ocl::dumpOpenCLDevice();
#else
#define TEST_DUMP_OCL_INFO
#endif
#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
CV_TRACE_FUNCTION(); \
@@ -654,11 +645,10 @@ void dumpOpenCLDevice();
::perf::TestBase::Init(std::vector<std::string>(impls, impls + sizeof impls / sizeof *impls), \
argc, argv); \
::testing::InitGoogleTest(&argc, argv); \
cvtest::printVersionInfo(); \
::testing::UnitTest::GetInstance()->listeners().Append(new cvtest::SystemInfoCollector); \
::testing::Test::RecordProperty("cv_module_name", #modulename); \
::perf::TestBase::RecordRunParameters(); \
__CV_TEST_EXEC_ARGS(__VA_ARGS__) \
TEST_DUMP_OCL_INFO \
} \
return RUN_ALL_TESTS();