@@ -37,8 +37,11 @@ define_regression_test_with_patches!(simple_ironing_out);
3737/// The tolerance when comparing floating-point values in CSV files
3838const FLOAT_CMP_TOLERANCE : f64 = 1e-10 ;
3939
40- /// Run a regression test for the given example with optional extra arguments to `muse2 run`.
41- fn run_regression_test ( example : & str , extra_args : & [ & str ] ) {
40+ /// Run a regression test for the given example with optional extra arguments to `muse2 example run`.
41+ ///
42+ /// The `--debug-model` flag is always used so the debug files are available to examine. The debug
43+ /// files are only tested when the `debug_model` parameter is true.
44+ fn run_regression_test ( example : & str , extra_args : & [ & str ] , debug_model : bool ) {
4245 // Allow user to set output dir for regression tests so they can examine results. This is
4346 // principally intended for use by CI.
4447 let tmp: TempDir ;
@@ -51,17 +54,20 @@ fn run_regression_test(example: &str, extra_args: &[&str]) {
5154
5255 // Invoke muse2
5356 let output_dir_str = output_dir. to_string_lossy ( ) ;
54- let mut args = vec ! [ "example" , "run" , example, "--output-dir" , & output_dir_str] ;
57+ let mut args = vec ! [
58+ "example" ,
59+ "run" ,
60+ example,
61+ "--debug-model" ,
62+ "--output-dir" ,
63+ & output_dir_str,
64+ ] ;
5565 args. extend ( extra_args) ;
5666 assert_muse2_runs ( & args) ;
5767
5868 // Check that the output files match (approximately)
5969 let test_data_dir = PathBuf :: from ( format ! ( "tests/data/{example}" ) ) ;
60- compare_output_dirs (
61- & output_dir,
62- & test_data_dir,
63- extra_args. contains ( & "--debug-model" ) ,
64- ) ;
70+ compare_output_dirs ( & output_dir, & test_data_dir, debug_model) ;
6571}
6672
6773fn compare_output_dirs ( cur_output_dir1 : & Path , test_data_dir : & Path , debug_model : bool ) {
0 commit comments