From: Dr. David von Oheimb Date: Sat, 20 Jun 2020 15:20:20 +0000 (+0200) Subject: test/run_tests.pl: Improve indentation parsing workaround for VFO and VFP mode X-Git-Tag: openssl-3.0.0-alpha4~50 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=93a7d24179ee5f61a2350b547dfcd522f6a4b9b0;p=oweals%2Fopenssl.git test/run_tests.pl: Improve indentation parsing workaround for VFO and VFP mode Reviewed-by: Nicola Tuveri (Merged from https://github.com/openssl/openssl/pull/12175) --- diff --git a/test/run_tests.pl b/test/run_tests.pl index 8a4e770a75..8306c6018a 100644 --- a/test/run_tests.pl +++ b/test/run_tests.pl @@ -157,13 +157,18 @@ $eres = eval { my $tests_planned = $is_plan && $self->tests_planned; my $is_test = $self->is_test; my $is_ok = $is_test && $self->is_ok; - # workaround in case parser not coping with indentation: + + # workaround for parser not coping with sub-test indentation if ($self->is_unknown) { + my $level = $#plans; + my $indent = $level < 0 ? "" : " " x ($level * 4); + ($is_plan, $tests_planned) = (1, $1) - if ($self->as_string =~ m/^\s+1\.\.(\d+)/); + if ($self->as_string =~ m/^$indent 1\.\.(\d+)/); ($is_test, $is_ok) = (1, !$1) - if ($self->as_string =~ m/^\s+(not )?ok /); + if ($self->as_string =~ m/^$indent(not )?ok /); } + if ($is_plan) { push @plans, $tests_planned; $output_buffer = ""; # ignore comments etc. until plan