From 10102c09b67a1f1dd71e035a768fdeb86a1e85f2 Mon Sep 17 00:00:00 2001 From: Ryan Lai Date: Mon, 5 Apr 2021 14:59:19 -0700 Subject: [PATCH] Add better model test error messaging (#7239) --- winml/test/model/model_tests.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winml/test/model/model_tests.cpp b/winml/test/model/model_tests.cpp index 0576c328be..74bc3052b3 100644 --- a/winml/test/model/model_tests.cpp +++ b/winml/test/model/model_tests.cpp @@ -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\\";