correctly re-enable platform-switching tests

This commit is contained in:
Brendan Hansknecht 2022-07-22 23:42:08 -07:00
parent b8c7ee6cb8
commit dedc408e3d
No known key found for this signature in database
GPG key ID: A2E3B0B6E483038E

View file

@ -813,9 +813,26 @@ mod cli_run {
let entry = entry.unwrap();
if entry.file_type().unwrap().is_dir() {
// TODO: Improve this with a more-dynamic approach. (Read all subdirectories?)
let example_dir_name = entry.file_name().into_string().unwrap();
// TODO: Improve this with a more-dynamic approach. (Read all subdirectories?)
if example_dir_name == "platform-switching" {
for sub_dir in [
// We exclude the C platforming switching example
// because the main platform switching example runs the c platform.
// If we don't a race condition leads to test flakiness.
// "c-platform",
"rust-platform",
"swift-platform",
"web-assembly-platform",
"zig-platform",
] {
all_examples.remove(format!("{}/{}", example_dir_name, sub_dir).as_str()).unwrap_or_else(|| {
panic!("The example directory {}/{}/{} does not have any corresponding tests in cli_run. Please add one, so if it ever stops working, we'll know about it right away!", examples_dir, example_dir_name, sub_dir);
});
}
}
// We test benchmarks separately
if example_dir_name != "benchmarks" {
all_examples.remove(example_dir_name.as_str()).unwrap_or_else(|| {