mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
Merge pull request #877 from apavlenko:version_info_in_test_log
This commit is contained in:
commit
1348e7cd4d
@ -554,6 +554,7 @@ namespace cvtest
|
|||||||
CV_EXPORTS void fillGradient(Mat& img, int delta = 5);
|
CV_EXPORTS void fillGradient(Mat& img, int delta = 5);
|
||||||
CV_EXPORTS void smoothBorder(Mat& img, const Scalar& color, int delta = 3);
|
CV_EXPORTS void smoothBorder(Mat& img, const Scalar& color, int delta = 3);
|
||||||
|
|
||||||
|
CV_EXPORTS void printVersionInfo(bool useStdOut = true);
|
||||||
} //namespace cvtest
|
} //namespace cvtest
|
||||||
|
|
||||||
// fills c with zeros
|
// fills c with zeros
|
||||||
@ -573,6 +574,7 @@ int main(int argc, char **argv) \
|
|||||||
{ \
|
{ \
|
||||||
cvtest::TS::ptr()->init(resourcesubdir); \
|
cvtest::TS::ptr()->init(resourcesubdir); \
|
||||||
::testing::InitGoogleTest(&argc, argv); \
|
::testing::InitGoogleTest(&argc, argv); \
|
||||||
|
cvtest::printVersionInfo();\
|
||||||
return RUN_ALL_TESTS(); \
|
return RUN_ALL_TESTS(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,6 +484,7 @@ int main(int argc, char **argv)\
|
|||||||
::perf::Regression::Init(#testsuitname);\
|
::perf::Regression::Init(#testsuitname);\
|
||||||
::perf::TestBase::Init(argc, argv);\
|
::perf::TestBase::Init(argc, argv);\
|
||||||
::testing::InitGoogleTest(&argc, argv);\
|
::testing::InitGoogleTest(&argc, argv);\
|
||||||
|
cvtest::printVersionInfo();\
|
||||||
return RUN_ALL_TESTS();\
|
return RUN_ALL_TESTS();\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2934,8 +2934,34 @@ MatComparator::operator()(const char* expr1, const char* expr2,
|
|||||||
<< "'" << expr2 << "': " << MatPart(m2part, border > 0 ? &loc : 0) << ".\n";
|
<< "'" << expr2 << "': " << MatPart(m2part, border > 0 ? &loc : 0) << ".\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printVersionInfo(bool useStdOut)
|
||||||
|
{
|
||||||
|
::testing::Test::RecordProperty("CV_VERSION", CV_VERSION);
|
||||||
|
if(useStdOut) std::cout << "OpenCV version: " << CV_VERSION << std::endl;
|
||||||
|
|
||||||
|
std::string buildInfo( cv::getBuildInformation() );
|
||||||
|
|
||||||
|
size_t pos1 = buildInfo.find("Version control");
|
||||||
|
size_t pos2 = buildInfo.find("\n", pos1);\
|
||||||
|
if(pos1 != std::string::npos && pos2 != std::string::npos)
|
||||||
|
{
|
||||||
|
std::string ver( buildInfo.substr(pos1, pos2-pos1) );
|
||||||
|
::testing::Test::RecordProperty("Version_control", ver);
|
||||||
|
if(useStdOut) std::cout << ver << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
pos1 = buildInfo.find("inner version");
|
||||||
|
pos2 = buildInfo.find("\n", pos1);\
|
||||||
|
if(pos1 != std::string::npos && pos2 != std::string::npos)
|
||||||
|
{
|
||||||
|
std::string ver( buildInfo.substr(pos1, pos2-pos1) );
|
||||||
|
::testing::Test::RecordProperty("inner_version", ver);
|
||||||
|
if(useStdOut) std::cout << ver << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} //namespace cvtest
|
||||||
|
|
||||||
void cvTsConvert( const CvMat* src, CvMat* dst )
|
void cvTsConvert( const CvMat* src, CvMat* dst )
|
||||||
{
|
{
|
||||||
Mat _src = cvarrToMat(src), _dst = cvarrToMat(dst);
|
Mat _src = cvarrToMat(src), _dst = cvarrToMat(dst);
|
||||||
|
Loading…
Reference in New Issue
Block a user