mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #20995 from mpashchenkov:mp/ocv-gapi-tdp-skip
G-API: Removing G-API test code that is a reflection of ts module * gapi: don't hijack testing infrastructure * Removed initDataPath functionality (ts module exists) * Removed false for ocv_extra data from findDataFile Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c7df82460c
commit
2f6d2b08aa
@@ -58,40 +58,6 @@ namespace
|
||||
return o;
|
||||
}
|
||||
|
||||
inline bool initTestDataPathSilent()
|
||||
{
|
||||
#ifndef WINRT
|
||||
static bool initialized = false;
|
||||
if (!initialized)
|
||||
{
|
||||
// Since G-API has no own test data (yet), it is taken from the common space
|
||||
const char* testDataPath = getenv("OPENCV_TEST_DATA_PATH");
|
||||
if (testDataPath != nullptr) {
|
||||
cvtest::addDataSearchPath(testDataPath);
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
return initialized;
|
||||
#endif // WINRT
|
||||
}
|
||||
|
||||
inline void initTestDataPath()
|
||||
{
|
||||
bool initialized = initTestDataPathSilent();
|
||||
GAPI_Assert(initialized &&
|
||||
"OPENCV_TEST_DATA_PATH environment variable is either not set or set incorrectly.");
|
||||
}
|
||||
|
||||
inline void initTestDataPathOrSkip()
|
||||
{
|
||||
bool initialized = initTestDataPathSilent();
|
||||
if (!initialized)
|
||||
{
|
||||
throw cvtest::SkipTestException("Can't find test data");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T> inline void initPointRandU(cv::RNG &rng, cv::Point_<T>& pt)
|
||||
{
|
||||
GAPI_Assert(std::is_integral<T>::value);
|
||||
@@ -299,7 +265,6 @@ public:
|
||||
|
||||
void initMatFromImage(int type, const std::string& fileName)
|
||||
{
|
||||
initTestDataPath();
|
||||
|
||||
int channels = (type >> CV_CN_SHIFT) + 1;
|
||||
GAPI_Assert(channels == 1 || channels == 3 || channels == 4);
|
||||
@@ -323,7 +288,6 @@ public:
|
||||
|
||||
void initMatsFromImages(int channels, const std::string& pattern, int imgNum)
|
||||
{
|
||||
initTestDataPath();
|
||||
GAPI_Assert(channels == 1 || channels == 3 || channels == 4);
|
||||
const int flags = (channels == 1) ? cv::IMREAD_GRAYSCALE : cv::IMREAD_COLOR;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user