X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/117ebc7716bc59003c726bd41ce876cd19923c4b..7862d928239639a5fbde23866f80f1b234ff8396:/tools/cmake/scripts/generate_memcheck_tests.pl diff --git a/tools/cmake/scripts/generate_memcheck_tests.pl b/tools/cmake/scripts/generate_memcheck_tests.pl index f57f8a274e..f8ea4e9e18 100755 --- a/tools/cmake/scripts/generate_memcheck_tests.pl +++ b/tools/cmake/scripts/generate_memcheck_tests.pl @@ -21,12 +21,12 @@ open MAKETEST, $ARGV[1] or die "Unable to open file: \"$ARGV[1]\". $!\n"; sub var_subst { my ($text, $name, $value) = @_; if ($value) { - $text =~ s/\${$name(?::[=-][^}]*)?}/$value/g; + $text =~ s/\$\{$name(?::[=-][^}]*)?\}/$value/g; $text =~ s/\$$name(\W|$)/$value$1/g; } else { - $text =~ s/\${$name:=([^}]*)}/$1/g; - $text =~ s/\${$name}//g; + $text =~ s/\$\{$name:=([^}]*)\}/$1/g; + $text =~ s/\$\{$name}//g; $text =~ s/\$$name(\W|$)/$1/g; } return $text; @@ -88,7 +88,7 @@ while ( defined( $line = ) ) { if ( $line =~ /(\S+)\s*\)$/ ) { $tesh_file = $1; $tesh_file =~ s/^[^\/\$]/$path\/$&/; - $tesh_file =~ s/\${CMAKE_HOME_DIRECTORY}/$proj_dir/g; + $tesh_file =~ s/\$\{CMAKE_HOME_DIRECTORY\}/$proj_dir/g; if ( ! -e "$tesh_file" ) { print "# tesh_file: $tesh_file does not exist!\n"; print "# $line\n"; @@ -140,7 +140,7 @@ while ( defined( $line = ) ) { } if ( $command =~ /^mkfile\s+(\S+)/) { my $file = $1; - # don't ask me to explain why so many backslashes... + # don't ask me why so many backslashes. http://xkcd.com/1638/ $input =~ s/\\/\\\\\\\\/g; $input =~ s/\n/\\\\n/g; $input =~ s/"/\\\\042/g; @@ -152,13 +152,16 @@ while ( defined( $line = ) ) { foreach my $factory (split(';', $factories)) { $close=0; if( $factory =~ /^raw/) { - print "${indent}if(HAVE_RAWCTX)\n"; + print "${indent}if(HAVE_RAW_CONTEXTS)\n"; $close=1; }elsif( $factory =~ /^boost/) { - print "${indent}if(HAVE_BOOST_CONTEXT)\n"; + print "${indent}if(HAVE_BOOST_CONTEXTS)\n"; $close=1; }elsif( $factory =~ /^ucontext/) { - print "${indent}if(CONTEXT_UCONTEXT)\n"; + print "${indent}if(HAVE_UCONTEXT_CONTEXTS)\n"; + $close=1; + }elsif( $factory =~ /^thread/) { + print "${indent}if(HAVE_THREAD_CONTEXTS)\n"; $close=1; } print "${indent}ADD_TEST(NAME memcheck-$name_test-$factory-$count\n";