diff options
Diffstat (limited to 'tests/InferenceTest.cpp')
-rw-r--r-- | tests/InferenceTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/InferenceTest.cpp b/tests/InferenceTest.cpp index 89e78def2f..cf97459ddc 100644 --- a/tests/InferenceTest.cpp +++ b/tests/InferenceTest.cpp @@ -92,6 +92,12 @@ bool ParseCommandLine(int argc, char** argv, IInferenceTestCaseProvider& testCas bool ValidateDirectory(std::string& dir) { + if (dir.empty()) + { + std::cerr << "No directory specified" << std::endl; + return false; + } + if (dir[dir.length() - 1] != '/') { dir += "/"; @@ -103,6 +109,12 @@ bool ValidateDirectory(std::string& dir) return false; } + if (!boost::filesystem::is_directory(dir)) + { + std::cerr << "Given directory [" << dir << "] is not a directory" << std::endl; + return false; + } + return true; } |