(path: &Path, benchmark_directory: &Path)
| 1237 | } |
| 1238 | |
| 1239 | fn parse_group_from_path(path: &Path, benchmark_directory: &Path) -> String { |
| 1240 | let mut group_name = String::new(); |
| 1241 | let mut parent = path.parent(); |
| 1242 | |
| 1243 | while let Some(p) = parent { |
| 1244 | if path_ends_with_ignore_ascii_case(p, benchmark_directory) { |
| 1245 | break; |
| 1246 | } |
| 1247 | |
| 1248 | if let Some(dir_name) = p.file_name() { |
| 1249 | group_name = dir_name.to_string_lossy().into_owned(); |
| 1250 | } |
| 1251 | |
| 1252 | parent = p.parent(); |
| 1253 | } |
| 1254 | |
| 1255 | if group_name.is_empty() { |
| 1256 | warn!("Unable to find group name in path: {}", path.display()); |
| 1257 | } |
| 1258 | |
| 1259 | group_name |
| 1260 | } |
| 1261 | |
| 1262 | fn path_ends_with_ignore_ascii_case(path: &Path, suffix: &Path) -> bool { |
| 1263 | let mut path_components = path.components().rev(); |
searching dependent graphs…