Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove some tests from memcheck tests. They purposely do not finish cleanly.
[simgrid.git] / buildtools / Cmake / Scripts / generate_memcheck_tests.pl
index 3f7652f..33fd3bb 100755 (executable)
@@ -8,7 +8,7 @@ if ( $#ARGV != 1 ) {
 }
 
 my ($proj_dir) = $ARGV[0];
-open MAKETEST, $ARGV[1] or die "Unable to open $ARGV[1]. $!\n";
+open MAKETEST, $ARGV[1] or die "Unable to open file: \"$ARGV[1]\". $!\n";
 
 sub var_subst {
     my ($text, $name, $value) = @_;
@@ -38,6 +38,7 @@ my ($indent);
 while ( defined( $line = <MAKETEST> ) ) {
     chomp $line;
     if ( $line =~ /BEGIN TESH TESTS/ ) {
+        print "SET( MEMCHECK 1) \n";
         $dump = 1;
         next;
     }
@@ -71,7 +72,7 @@ while ( defined( $line = <MAKETEST> ) ) {
                 my ( $env_var, $value_var ) = ( $1, $2 );
                 $environ{$env_var} = $value_var;
             }
-            if ( $line =~ /(\S+)\)$/ ) {
+            if ( $line =~ /(\S+)\s*\)$/ ) {
                 $tesh_file = $1;
                 $tesh_file =~ s/^[^\/\$]/$path\/$&/;
                 $tesh_file =~ s/\${CMAKE_HOME_DIRECTORY}/$proj_dir/g;
@@ -96,7 +97,7 @@ while ( defined( $line = <MAKETEST> ) ) {
             my ($count)        = 0;
             my ($count_first)  = 0;
             my ($count_second) = 0;
-            open TESH_FILE, $tesh_file or die "Unable to open $tesh_file $!\n";
+            open TESH_FILE, $tesh_file or die "Unable to open tesh file: \"$tesh_file\". $!\n";
             my ($input) = "";
             my ($l);
             while ( defined( $l = <TESH_FILE> ) ) {