From 145029726ec6891f5818e2888e9e55e7ae1e3f50 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 26 Jun 2012 19:09:13 +0200 Subject: [PATCH] Make generate_memcheck_tests.pl keep indentation (but the two first space). --- buildtools/Cmake/Scripts/generate_memcheck_tests.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/buildtools/Cmake/Scripts/generate_memcheck_tests.pl b/buildtools/Cmake/Scripts/generate_memcheck_tests.pl index 23699bbf04..b8528d9649 100755 --- a/buildtools/Cmake/Scripts/generate_memcheck_tests.pl +++ b/buildtools/Cmake/Scripts/generate_memcheck_tests.pl @@ -34,6 +34,7 @@ my ($bindir); my ($tesh_file); my ($config_var); my ($name_test); +my ($indent); while ( defined( $line = ) ) { chomp $line; @@ -46,6 +47,7 @@ while ( defined( $line = ) ) { last; } if ($dump) { + $line =~ s/^ //; if ( $line =~ /^\s*ADD_TEST\(\S+\s+\S*\/tesh\s/ ) { $srcdir = ""; $bindir = ""; @@ -54,9 +56,11 @@ while ( defined( $line = ) ) { $nb_test++; $tesh_file = ""; $name_test = ""; + $indent = ""; - if ( $line =~ /ADD_TEST\((\S+)/ ) { - $name_test = ($1); + if ( $line =~ /^(\s*)ADD_TEST\((\S+)/ ) { + $indent = ($1); + $name_test = ($2); } while ( $line =~ /--cfg\s+(\S+)/g ) { $config_var = "--cfg=$1 $config_var"; @@ -119,7 +123,7 @@ while ( defined( $line = ) ) { if ($config_var) { $command = "$command $config_var"; } - print "ADD_TEST(memcheck-$name_test-$count $command --cd $path\/)\n"; + print "${indent}ADD_TEST(memcheck-$name_test-$count $command --cd $path\/)\n"; #push @test_list, "memcheck-$name_test-$count"; $count++; -- 2.20.1