]> The Tcpdump Group git mirrors - libpcap/commitdiff
TESTrun: Refine the generation of apply test requests.
authorDenis Ovsienko <[email protected]>
Tue, 25 Feb 2025 09:24:56 +0000 (09:24 +0000)
committerDenis Ovsienko <[email protected]>
Tue, 25 Feb 2025 19:14:37 +0000 (19:14 +0000)
Add a check for the "skip" key, as is done for the other test types (the
next changes are going to require that).  Assign a variable before a
loop, not within.

testprogs/TESTrun

index dd59dea7c1696a2fcd94acafb30537d286563853..bce2750b104f0cdb7b375474f8f66eec3a777804 100755 (executable)
@@ -9872,11 +9872,24 @@ foreach my $blockname (sort keys %apply_blocks) {
                next if defined $block->{$_};
                die "Internal error: apply test block '$blockname' does not define key '$_'";
        }
+       my $skip_reason = (defined $block->{skip} && $block->{skip} ne '') ?
+               $block->{skip} : undef;
+       # Convert the array to filtertest output format.
+       my $multiline = join ("\n", @{$block->{results}}) . "\n";
        foreach my $optunopt ('unopt', 'opt') {
                my $label = apply_test_label ($blockname, $optunopt);
                next if defined $only_one && $only_one ne $label;
-               # Convert the array to filtertest output format.
-               my $multiline = join ("\n", @{$block->{results}}) . "\n";
+
+               if (defined $skip_reason) {
+                       push @ready_to_run, {
+                               label => $label,
+                               func => \&run_skip_test,
+                               skip => $skip_reason,
+                       };
+                       $skip_reason = '';
+                       next;
+               }
+
                push @ready_to_run, {
                        label => $label,
                        func => \&run_apply_test,