mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
treat platform-switching similarly to benchmarks
This commit is contained in:
parent
780945061f
commit
a1543b5cc4
1 changed files with 25 additions and 16 deletions
|
@ -822,26 +822,35 @@ mod cli_run {
|
||||||
let example_dir_name = entry.file_name().into_string().unwrap();
|
let example_dir_name = entry.file_name().into_string().unwrap();
|
||||||
|
|
||||||
// TODO: Improve this with a more-dynamic approach. (Read all subdirectories?)
|
// TODO: Improve this with a more-dynamic approach. (Read all subdirectories?)
|
||||||
// Some platform-switching examples live in nested directories
|
// Some platform-switching examples live in nested directories, and
|
||||||
|
// the rocLovesFoo.roc examples live directly under the platform-switching directory
|
||||||
if example_dir_name == "platform-switching" {
|
if example_dir_name == "platform-switching" {
|
||||||
for sub_dir in [
|
// The subdirectory checks broke when we moved the rodLovesFoo.roc examples
|
||||||
// We exclude the C platforming switching example
|
// Treating the platform-switching directory similarly to the benchmarks directory for now
|
||||||
// because the main platform switching example runs the c platform.
|
|
||||||
// If we don't a race condition leads to test flakiness.
|
all_examples.remove(example_dir_name.as_str()).unwrap_or_else(|| {
|
||||||
// "c-platform",
|
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);
|
||||||
"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);
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
// 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
|
// We test benchmarks separately
|
||||||
if example_dir_name != "benchmarks" {
|
// platform-switching examples are handled above
|
||||||
|
if example_dir_name != "benchmarks" && example_dir_name != "platform-switching" {
|
||||||
all_examples.remove(example_dir_name.as_str()).unwrap_or_else(|| {
|
all_examples.remove(example_dir_name.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);
|
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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue