MCPcopy Create free account
hub / github.com/ARM-software/armnn / ValidateDirectory

Function ValidateDirectory

tests/InferenceTest.cpp:84–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool ValidateDirectory(std::string& dir)
85{
86 if (dir.empty())
87 {
88 std::cerr << "No directory specified" << std::endl;
89 return false;
90 }
91
92 if (dir[dir.length() - 1] != '/')
93 {
94 dir += "/";
95 }
96
97 if (!fs::exists(dir))
98 {
99 std::cerr << "Given directory " << dir << " does not exist" << std::endl;
100 return false;
101 }
102
103 if (!fs::is_directory(dir))
104 {
105 std::cerr << "Given directory [" << dir << "] is not a directory" << std::endl;
106 return false;
107 }
108
109 return true;
110}
111
112bool InferenceTest(const InferenceTestOptions& params,
113 const std::vector<unsigned int>& defaultTestCaseIds,

Callers 7

mainFunction · 0.85
ParseOptionsMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

existsFunction · 0.85
is_directoryFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected