Adding test support for WINRT

This commit is contained in:
Evgeny Agafonchikov
2015-05-18 11:57:18 +03:00
parent 8869150649
commit 6a6d58d389
19 changed files with 303 additions and 21 deletions

View File

@@ -185,7 +185,11 @@ void Regression::init(const std::string& testSuitName, const std::string& ext)
return;
}
#ifndef WINRT
const char *data_path_dir = getenv("OPENCV_TEST_DATA_PATH");
#else
const char *data_path_dir = OPENCV_TEST_DATA_PATH;
#endif
const char *path_separator = "/";
if (data_path_dir)
@@ -814,7 +818,12 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
param_force_samples = args.get<unsigned int>("perf_force_samples");
param_write_sanity = args.has("perf_write_sanity");
param_verify_sanity = args.has("perf_verify_sanity");
#ifndef WINRT
test_ipp_check = !args.has("perf_ipp_check") ? getenv("OPENCV_IPP_CHECK") != NULL : true;
#else
test_ipp_check = false;
#endif
param_threads = args.get<int>("perf_threads");
#ifdef CV_COLLECT_IMPL_DATA
param_collect_impl = args.has("perf_collect_impl");
@@ -881,7 +890,11 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
#endif
{
#ifndef WINRT
const char* path = getenv("OPENCV_PERF_VALIDATION_DIR");
#else
const char* path = OPENCV_PERF_VALIDATION_DIR;
#endif
if (path)
perf_validation_results_directory = path;
}
@@ -1185,7 +1198,11 @@ bool TestBase::next()
printf("Performance is unstable, it may be a result of overheat problems\n");
printf("Idle delay for %d ms... \n", perf_validation_idle_delay_ms);
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
#ifndef WINRT_8_0
Sleep(perf_validation_idle_delay_ms);
#else
WaitForSingleObjectEx(GetCurrentThread(), perf_validation_idle_delay_ms, FALSE);
#endif
#else
usleep(perf_validation_idle_delay_ms * 1000);
#endif
@@ -1635,7 +1652,11 @@ std::string TestBase::getDataPath(const std::string& relativePath)
throw PerfEarlyExitException();
}
#ifndef WINRT
const char *data_path_dir = getenv("OPENCV_TEST_DATA_PATH");
#else
const char *data_path_dir = OPENCV_TEST_DATA_PATH;
#endif
const char *path_separator = "/";
std::string path;