+ if ( $command =~ /^mkfile\s+(\S+)/) {
+ my $file = $1;
+ # don't ask me to explain why so many backslashes...
+ $input =~ s/\\/\\\\\\\\/g;
+ $input =~ s/\n/\\\\n/g;
+ $input =~ s/"/\\\\042/g;
+ $input =~ s/'/\\\\047/g;
+ $input =~ s/%/%%/g;
+ $command = "sh -c \"printf '$input' > $file\"";
+ }
+ if ($factories) {
+ foreach my $factory (split(';', $factories)) {
+ 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 = "";