[cig-commits] commit: Now produces a warning to stderr if an 'Error' or 'error' is detected in the stderr of the Underworld run

Mercurial hg at geodynamics.org
Fri Feb 5 12:09:07 PST 2010


changeset:   247:d9f635194ab6
branch:      1.4.x
user:        JulianGiordani
date:        Tue Jan 19 16:26:32 2010 +1100
files:       script/systest.pl
description:
Now produces a warning to stderr if an 'Error' or 'error' is detected in the stderr of the Underworld run


diff -r 16bd000210f9 -r d9f635194ab6 script/systest.pl
--- a/script/systest.pl	Tue Jan 19 11:18:54 2010 +1100
+++ b/script/systest.pl	Tue Jan 19 16:26:32 2010 +1100
@@ -206,19 +206,22 @@ sub runTests {
 	print "$command";
 	&executeCommandline( $command );
 
-	# check error stream for error result
-	open( ERROR, "<$stderr" );
-	my $line;
-	foreach $line (<ERROR>) {
-		if( $line =~ m/[E|e]rror/ ) {
-			close(ERROR); 
-			die ("\n\n### ERROR ###\nError in runtime: see $stderr or $stdout - stopped" ); 
-		}
-	}
+	# check error stream for error result and produce warning
+   my $rm_stderr = 1;
+   open( ERROR, "<$stderr" );
+   my $line;
+   foreach $line (<ERROR>) {
+      if( $line =~ m/[E|e]rror/ ) {
+         close(ERROR); 
+         warn ("\n\n### Warning ###\nError reported in runtime: see $stderr - stopped" ); 
+         $rm_stderr=0;
+         last; # break out of the foreach loop
+      }
+   }
 
-	# if no error close file and delete it
-	close(ERROR); 
-	$command = "rm $stderr"; &executeCommandline($command);
+   # if no error close file and delete it
+   close(ERROR); 
+   if( $rm_stderr ) { $command = "rm $stderr"; &executeCommandline($command); }
 
 	# removing help.xml
 	$command = "rm help.xml";



More information about the CIG-COMMITS mailing list