4 # input file = CMakeTest.txt
7 die "Usage: generate_memcheck_tests.pl <project_directory> <CMakeTests.txt>\n";
10 my($proj_dir)=$ARGV[0];
11 open MAKETEST, $ARGV[1] or die "Unable to open $ARGV[1]. $!\n";
17 while(defined($line=<MAKETEST>)) {
19 if($line =~ /BEGIN TESH TESTS/) {
23 if($line =~ /END TESH TESTS/) {
28 if($line =~ /ADD_TEST/) {
29 if($line =~ /ADD_TEST\(([\S]+)\s+.*\/tools\/tesh\/tesh\s*--cd\s*(\S+)\s+(.*)\)$/) {
30 my($name_test,$path,$tesh_file)=($1,$2,$3);
32 my($complete_tesh_file)=$path."/".$tesh_file;
36 $complete_tesh_file =~ s/\${PROJECT_DIRECTORY}/$proj_dir/g;
37 open TESH_FILE, $complete_tesh_file or die "Unable to open $complete_tesh_file $!\n";
39 while(defined($l=<TESH_FILE>)) {
41 if($l =~ /^\$ (.*)$/) {
43 $command =~ s/\${srcdir:=.}/./g;
44 $command =~ s/\${EXEEXT:=}//g;
45 $command =~ s/\$SG_TEST_EXENV //g;
46 $command =~ s/\$SG_TEST_ENV //g;
47 $command =~ s/\$SG_EXENV_TEST //g;
48 $command =~ s/\$EXEEXT//g;
49 $command =~ s/\${srcdir}/\${PROJECT_DIRECTORY}\/src/g;
50 $command =~ s/ \$ARGS//g;
51 $command =~ s/ \$@ //g;
52 $path =~ s/\${PROJECT_DIRECTORY}/~\/Developments\/simgrid/g;
53 #$command =~ s/\${PROJECT_DIRECTORY}/~\/Developments\/simgrid/g;
54 print "ADD_TEST(memcheck-$name_test-$count $command --cd $path\/)\n";
55 #push @test_list, "memcheck-$name_test-$count";
58 if($l =~ /^\& (.*)$/) {
73 #print "set(MEMCHECK_LIST\n";
74 #print (join("\n", @test_list));