diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index bab664666c..1db96ec351 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -412,7 +412,7 @@ sub cat_and_create_namelistinfile { } } } - system( "/bin/rm $namelistfile" ); + system( "/bin/rm -f $namelistfile" ); &cleanup(); } print "\n===============================================================================\n"; @@ -466,7 +466,7 @@ sub cat_and_create_namelistinfile { if ( defined($opts{'generate'}) ) { $cfiles->copyfiles( "$options", $mode ); } - system( "/bin/rm $namelistfile" ); + system( "/bin/rm -f $namelistfile" ); &cleanup(); } @@ -1303,6 +1303,7 @@ sub cat_and_create_namelistinfile { eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; isnt( $?, 0, $key ); system( "cat $tempfile" ); + &cleanup(); } @@ -1386,12 +1387,14 @@ sub cat_and_create_namelistinfile { eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; isnt( $?, 0, $key ); system( "cat $tempfile" ); + &cleanup(); # Now run with -ignore_warnings and make sure it works $options .= " -ignore_warnings"; eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; is( $?, 0, $key ); is( $@, '', "$options" ); system( "cat $tempfile" ); + &cleanup(); } print "\n===============================================================================\n"; @@ -1442,6 +1445,7 @@ sub cat_and_create_namelistinfile { $finidat = `grep finidat lnd_in`; ok ( $finidat =~ "testfile.nc", "coldwfinidat $key finidat? $finidat" ); } + &cleanup(); } # @@ -1971,7 +1975,7 @@ sub cat_and_create_namelistinfile { } &cleanup(); -system( "/bin/rm $finidat" ); +system( "/bin/rm -f $finidat" ); print "\n==================================================\n"; print " Dumping output \n"; @@ -1982,7 +1986,7 @@ sub cat_and_create_namelistinfile { print "Successfully ran all testing for build-namelist\n\n"; &cleanup( "config" ); -system( "/bin/rm $tempfile" ); +system( "/bin/rm -f $tempfile" ); sub cleanup { # @@ -1993,10 +1997,10 @@ sub cleanup { print "Cleanup files created\n"; if ( defined($type) ) { if ( $type eq "config" ) { - system( "/bin/rm config_cache.xml" ); + system( "/bin/rm -f config_cache.xml" ); } } else { - system( "/bin/rm $tempfile *_in" ); + system( "/bin/rm -f $tempfile *_in" ); } }