* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Check parent options for iterated tests
Unified · Split
| @@ -747,6 +747,18 @@ sub __eval_option { · 746 unmodified lines | ||
| 747 | 747 | # Add space to evaluate the character before $ |
| 748 | 748 | $option = " $option"; |
| 749 | 749 | my $retval = ""; |
| 750 | + my $repeated = 0; | |
| 751 | + my $parent = 0; | |
| 752 | + | |
| 753 | + foreach my $test (keys %repeat_tests) { | |
| 754 | + if ($i >= $test && | |
| 755 | + $i < $test + $repeat_tests{$test}) { | |
| 756 | + | |
| 757 | + $repeated = 1; | |
| 758 | + $parent = $test; | |
| 759 | + last; | |
| 760 | + } | |
| 761 | + } | |
| 750 | 762 | |
| 751 | 763 | while ($option =~ /(.*?[^\\])\$\{(.*?)\}(.*)/) { |
| 752 | 764 | my $start = $1; |
| @@ -760,10 +772,14 @@ sub __eval_option { · 7 unmodified lines | ||
| 760 | 772 | # otherwise see if the default OPT (without [$i]) exists. |
| 761 | 773 | |
| 762 | 774 | my $o = "$var\[$i\]"; |
| 775 | + my $parento = "$var\[$parent\]"; | |
| 763 | 776 | |
| 764 | 777 | if (defined($opt{$o})) { |
| 765 | 778 | $o = $opt{$o}; |
| 766 | 779 | $retval = "$retval$o"; |
| 780 | + } elsif ($repeated && defined($opt{$parento})) { | |
| 781 | + $o = $opt{$parento}; | |
| 782 | + $retval = "$retval$o"; | |
| 767 | 783 | } elsif (defined($opt{$var})) { |
| 768 | 784 | $o = $opt{$var}; |
| 769 | 785 | $retval = "$retval$o"; |