Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix generated file for memcheck.
[simgrid.git] / buildtools / Cmake / generate_memcheck_tests.pl
index c4b6db6..07d7bfe 100755 (executable)
@@ -14,7 +14,6 @@ my(@test_list)=();
 
 my($line);
 my($dump)=0;
-print "if(enable_memcheck)\n";
 while(defined($line=<MAKETEST>)) {
     chomp $line;
     if($line =~ /BEGIN TESH TESTS/) {
@@ -57,6 +56,10 @@ while(defined($line=<MAKETEST>)) {
                        $command =~ s/ \$ARGS//g;
                        $command =~ s/ \$@ //g; 
                        $command =~ s/..\/..\/bin\/smpirun/\${CMAKE_BINARY_DIR\}\/bin\/smpirun/g;
+                        if($command =~ /^[^\/\$\s]+\//) {
+                            $command = $path."/".$command;
+                            $command =~ s/\/(.?\/)+/\//g;
+                        }
                        print "ADD_TEST(memcheck-$name_test-$count $command --cd $path\/)\n";
                        #push @test_list, "memcheck-$name_test-$count";
                        $count++;
@@ -80,7 +83,6 @@ while(defined($line=<MAKETEST>)) {
     }   
 }
 close(MAKETEST);
-print "endif(enable_memcheck)\n";
 #print "set(MEMCHECK_LIST\n";
 #print (join("\n", @test_list));
 #print ")\n";