diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 2884f55b0..3e4731613 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -192,11 +192,7 @@ if ($opt_rerun && $runner->fail_count) { skip_cnt => $orig_runner->{skip_cnt}, unsup_cnt => $orig_runner->{unsup_cnt}); foreach my $test (@{$orig_runner->{fail_tests}}) { - if (0) { # TBD if this is required - rare that intermediate results are bad - # Remove old results to force hard rebuild - system("rm", "-rf", "$test->{obj_dir}__fail1"); - system("mv", "$test->{obj_dir}", "$test->{obj_dir}__fail1"); - } + $test->clean; # Reschedule test $runner->one_test(pl_filename => $test->{pl_filename}, $test->{scenario} => 1); @@ -795,6 +791,20 @@ sub _read_status { #---------------------------------------------------------------------- # Methods invoked by tests +sub clean { + my $self = (ref $_[0] ? shift : $Self); + # Called on a rerun to cleanup files + if ($self->{clean_command}) { + system($self->{clean_command}); + } + if (1) { + # Prevents false-failures when switching compilers + # Remove old results to force hard rebuild + system("rm", "-rf", "$self->{obj_dir}__fail1"); + system("mv", "$self->{obj_dir}", "$self->{obj_dir}__fail1"); + } +} + sub compile_vlt_cmd { my $self = (ref $_[0]? shift : $Self); my %param = (%{$self}, @_); # Default arguments are from $self diff --git a/test_regress/t/t_a4_examples.pl b/test_regress/t/t_a4_examples.pl index 09c6958ca..a4b6bdcde 100755 --- a/test_regress/t/t_a4_examples.pl +++ b/test_regress/t/t_a4_examples.pl @@ -10,6 +10,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(dist => 1); +$Self->{clean_command} = 'rm -rf ../examples/*/build ../examples/*/obj*'; + my @examples = sort(glob("../examples/*")); for my $example (@examples) { run(cmd=>["make -C $example"]);