X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5e697c041ca62e634c8fa224cf4164ff4cb6ac82..0135e2a94856488dc7242e1e862e901f166f944c:/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 d37977aae5..e3fa468dc4 100755 --- a/tools/cmake/scripts/generate_memcheck_tests.pl +++ b/tools/cmake/scripts/generate_memcheck_tests.pl @@ -9,10 +9,10 @@ use strict; use warnings; -# input file = AddTest.txt +# input file = Test.txt if ( $#ARGV != 1 ) { - die "Usage: generate_memcheck_tests.pl AddTests.cmake\n"; + die "Usage: generate_memcheck_tests.pl Tests.cmake\n"; } my ($proj_dir) = $ARGV[0]; @@ -108,6 +108,7 @@ while ( defined( $line = ) ) { } my ($count) = 0; + my ($close) = 0; open TESH_FILE, $tesh_file or die "Unable to open tesh file: \"$tesh_file\". $!\n"; my ($input) = ""; my ($l); @@ -139,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; @@ -149,6 +150,20 @@ while ( defined( $line = ) ) { } if ($factories) { foreach my $factory (split(';', $factories)) { + $close=0; + if( $factory =~ /^raw/) { + print "${indent}if(HAVE_RAWCTX)\n"; + $close=1; + }elsif( $factory =~ /^boost/) { + print "${indent}if(HAVE_BOOST_CONTEXT)\n"; + $close=1; + }elsif( $factory =~ /^ucontext/) { + print "${indent}if(CONTEXT_UCONTEXT)\n"; + $close=1; + }elsif( $factory =~ /^thread/) { + print "${indent}if(CONTEXT_THREADS)\n"; + $close=1; + } 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"; @@ -156,6 +171,9 @@ while ( defined( $line = ) ) { print "${indent}set_tests_properties(memcheck-$name_test-$factory-$count\n"; print "${indent} PROPERTIES DEPENDS memcheck-$name_test-$factory-" . ($count - 1) . ")\n"; } + if ($close > 0){ + print "${indent}endif()\n"; + } } } else { print "${indent}ADD_TEST(NAME memcheck-$name_test-$count\n";