Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Specify dependencies between memcheck tests.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 5 May 2014 11:43:46 +0000 (13:43 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 5 May 2014 12:38:59 +0000 (14:38 +0200)
Allows to run memcheck tests in parallel with e.g.
    ctest -D ExperimentalMemCheck -j 8

buildtools/Cmake/Scripts/generate_memcheck_tests.pl

index d6b1a32..1abc07c 100755 (executable)
@@ -107,8 +107,6 @@ 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: \"$tesh_file\". $!\n";
             my ($input) = "";
             my ($l);
@@ -153,11 +151,19 @@ while ( defined( $line = <MAKETEST> ) ) {
                         print "${indent}ADD_TEST(NAME memcheck-$name_test-$factory-$count\n";
                         print "${indent}         WORKING_DIRECTORY $path\/\n";
                         print "${indent}         COMMAND $command --cfg=contexts/factory:$factory)\n";
+                        if ($count > 0) {
+                            print "${indent}set_tests_properties(memcheck-$name_test-$factory-$count\n";
+                            print "${indent}                     PROPERTIES DEPENDS memcheck-$name_test-$factory-" . ($count - 1) . ")\n";
+                        }
                       }
                     } else {
                       print "${indent}ADD_TEST(NAME memcheck-$name_test-$count\n";
                       print "${indent}         WORKING_DIRECTORY $path\/\n";
                       print "${indent}         COMMAND $command)\n";
+                      if ($count > 0) {
+                          print "${indent}set_tests_properties(memcheck-$name_test-$count\n";
+                          print "${indent}                     PROPERTIES DEPENDS memcheck-$name_test-" . ($count - 1) . ")\n";
+                      }
                     }
                     $input = "";
                     #push @test_list, "memcheck-$name_test-$count";