mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Replace or remove some characters to meet gtest name convention (#13266)
### Description To construct test name, replace whitespace to underscore and remove parentheses ### Motivation and Context gtest name only accepts '_' and alphanumeric
This commit is contained in:
parent
febd5facce
commit
cd2e8b306c
1 changed files with 4 additions and 1 deletions
|
|
@ -1131,9 +1131,12 @@ auto ExpandModelName = [](const ::testing::TestParamInfo<ModelTest::ParamType>&
|
|||
std::replace(name.begin(), name.end(), '/', '_');
|
||||
std::replace(name.begin(), name.end(), '\\', '_');
|
||||
|
||||
// in case there's whitespace in directory name
|
||||
std::replace(name.begin(), name.end(), ' ', '_');
|
||||
|
||||
// Note: test name only accepts '_' and alphanumeric
|
||||
// remove '.', '-', ':'
|
||||
char chars[] = ".-:";
|
||||
char chars[] = ".-:()";
|
||||
for (unsigned int i = 0; i < strlen(chars); ++i) {
|
||||
name.erase(std::remove(name.begin(), name.end(), chars[i]), name.end());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue