File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
collector/src/compile/benchmark Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -620,13 +620,23 @@ mod tests {
620
620
#[ test]
621
621
fn check_compile_benchmarks ( ) {
622
622
// Check that we can deserialize all perf-config.json files in the compile benchmark
623
- // directory.
623
+ // directory and that they have [workspace] in their Cargo.toml .
624
624
let root = env ! ( "CARGO_MANIFEST_DIR" ) ;
625
- let benchmarks = get_compile_benchmarks (
626
- & Path :: new ( root) . join ( "compile-benchmarks" ) ,
627
- CompileBenchmarkFilter :: All ,
628
- )
629
- . unwrap ( ) ;
625
+ let benchmark_dir = Path :: new ( root) . join ( "compile-benchmarks" ) ;
626
+ let benchmarks =
627
+ get_compile_benchmarks ( & benchmark_dir, CompileBenchmarkFilter :: All ) . unwrap ( ) ;
630
628
assert ! ( !benchmarks. is_empty( ) ) ;
629
+
630
+ for benchmark in benchmarks {
631
+ let dir = benchmark_dir. join ( & benchmark. name . 0 ) ;
632
+ let cargo_toml = std:: fs:: read_to_string ( & dir. join ( "Cargo.toml" ) )
633
+ . expect ( & format ! ( "Cannot read Cargo.toml of {}" , benchmark. name) ) ;
634
+ if !cargo_toml. contains ( "[workspace]" ) {
635
+ panic ! (
636
+ "{} does not contain [workspace] in its Cargo.toml" ,
637
+ benchmark. name
638
+ ) ;
639
+ }
640
+ }
631
641
}
632
642
}
You can’t perform that action at this time.
0 commit comments