From a55ba1aaca3e846f6b1fdcfaa92e2ffe38abcf9e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 18:31:17 -0700 Subject: [PATCH 1/2] Add -f to calls of rm in build-namelist_test.pl. --- bld/unit_testers/build-namelist_test.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index bab664666c..973ea669ec 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(); } @@ -1971,7 +1971,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 +1982,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 +1993,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" ); } } From 234edb74fa52cea16041c108b1aa2b9a05cabad9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 12 Nov 2024 09:56:45 -0700 Subject: [PATCH 2/2] Add some cleanup calls. --- bld/unit_testers/build-namelist_test.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 973ea669ec..1db96ec351 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -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(); } #