Add better model test error messaging (#7239)

This commit is contained in:
Ryan Lai 2021-04-05 14:59:19 -07:00 committed by GitHub
parent e7c5dcd572
commit 10102c09b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,6 +143,10 @@ std::string GetTestDataPath() {
auto hardcodedModelPath = parentPath.string() + "\\models";
if (std::filesystem::exists(hardcodedModelPath) && hardcodedModelPath.length() <= MAX_PATH) {
return hardcodedModelPath;
} else {
std::string errorStr = "WINML_TEST_DATA_PATH environment variable path not found and \"models\" folder not found in same directory as test exe.\n";
std::cerr << errorStr;
throw std::exception(errorStr.c_str());
}
}
const std::string testDataPathFolderName = "\\testData\\";