Commit 4782b5904f2cddc7ecda86abc0590a2ff8715b33
1 parent
32f7d998
Move filter-completion.pl to libtests/arg_parser
Showing
2 changed files
with
6 additions
and
2 deletions
qpdf/qtest/qpdf/filter-completion.pl renamed to libtests/qtest/arg_parser/filter-completion.pl
| 1 | use warnings; | 1 | use warnings; |
| 2 | use strict; | 2 | use strict; |
| 3 | 3 | ||
| 4 | +# THIS SCRIPT IS ALSO USED IN qpdf.test | ||
| 5 | + | ||
| 4 | # Output every line from STDIN that appears in the file. | 6 | # Output every line from STDIN that appears in the file. |
| 5 | my %wanted = (); | 7 | my %wanted = (); |
| 6 | my %notwanted = (); | 8 | my %notwanted = (); |
qpdf/qtest/qpdf.test
| @@ -115,6 +115,8 @@ my @completion_tests = ( | @@ -115,6 +115,8 @@ my @completion_tests = ( | ||
| 115 | ['qpdf --encrypt user\ password ', undef, 'quoting'], | 115 | ['qpdf --encrypt user\ password ', undef, 'quoting'], |
| 116 | ); | 116 | ); |
| 117 | $n_tests += 2 * scalar(@completion_tests); | 117 | $n_tests += 2 * scalar(@completion_tests); |
| 118 | +my $completion_filter = | ||
| 119 | + "perl ../../../libtests/qtest/arg_parser/filter-completion.pl"; | ||
| 118 | foreach my $c (@completion_tests) | 120 | foreach my $c (@completion_tests) |
| 119 | { | 121 | { |
| 120 | my ($cmd, $point, $description) = @$c; | 122 | my ($cmd, $point, $description) = @$c; |
| @@ -126,12 +128,12 @@ foreach my $c (@completion_tests) | @@ -126,12 +128,12 @@ foreach my $c (@completion_tests) | ||
| 126 | } | 128 | } |
| 127 | $td->runtest("bash completion: $description", | 129 | $td->runtest("bash completion: $description", |
| 128 | {$td->COMMAND => [@{bash_completion($cmd, $point)}], | 130 | {$td->COMMAND => [@{bash_completion($cmd, $point)}], |
| 129 | - $td->FILTER => "perl filter-completion.pl $out"}, | 131 | + $td->FILTER => "$completion_filter $out"}, |
| 130 | {$td->FILE => "$out", $td->EXIT_STATUS => 0}, | 132 | {$td->FILE => "$out", $td->EXIT_STATUS => 0}, |
| 131 | $td->NORMALIZE_NEWLINES); | 133 | $td->NORMALIZE_NEWLINES); |
| 132 | $td->runtest("zsh completion: $description", | 134 | $td->runtest("zsh completion: $description", |
| 133 | {$td->COMMAND => [@{zsh_completion($cmd, $point)}], | 135 | {$td->COMMAND => [@{zsh_completion($cmd, $point)}], |
| 134 | - $td->FILTER => "perl filter-completion.pl $zout"}, | 136 | + $td->FILTER => "$completion_filter $zout"}, |
| 135 | {$td->FILE => "$zout", $td->EXIT_STATUS => 0}, | 137 | {$td->FILE => "$zout", $td->EXIT_STATUS => 0}, |
| 136 | $td->NORMALIZE_NEWLINES); | 138 | $td->NORMALIZE_NEWLINES); |
| 137 | } | 139 | } |