From 7d8a100783174ab88e64ea49ee76836ba39857e6 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Fri, 10 Jul 2009 22:36:06 +0000 Subject: [PATCH] - Added handling of escaped colon's in input --- tests/scripts/generate_code.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/scripts/generate_code.pl b/tests/scripts/generate_code.pl index 6aa9c05b8..f712395ce 100755 --- a/tests/scripts/generate_code.pl +++ b/tests/scripts/generate_code.pl @@ -50,8 +50,16 @@ while (my $line = ) $test_name =~ tr/A-Z \-/a-z__/; $test_name =~ tr/a-z0-9_//cd; + # Carve the case name and variable values + # my ( $case, $var_value ) = $command_line =~ /^([\w_]+):(.*)$/; + # Escape the escaped colons (Not really escaped now) + # + $var_value =~ s/\\:/{colon_sign}/g; + + # Carve the case and variable definition + # my ( $var_def, $case_code ) = $test_cases =~ /BEGIN_CASE\n$case:([^\n]*)\n(.*?)\nEND_CASE/s; my @var_def_arr = split(/:/, $var_def); @@ -66,6 +74,7 @@ while (my $line = ) } $case_code = "int ${test_name}_code_present = 0;\nTEST_ASSERT( ${test_name}_code_present == 1 );" if ($case_code =~ /^\s*$/); + $case_code =~ s/{colon_sign}/:/g; $case_code =~ s/TEST_ASSERT/fct_chk/g; $case_code =~ s/TEST_EQUALS/fct_chk/g;