summaryrefslogtreecommitdiff
path: root/tests/filename-lineno.pl
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2017-06-29 18:06:11 -0700
committerJim Meyering <meyering@fb.com>2017-07-01 09:30:51 -0700
commit9fbc2fb1823c71a9d3370e0b04886c5994000fa8 (patch)
tree4c7866f579ce32503a97fee1a45f498d21d31416 /tests/filename-lineno.pl
parentbdce7a23e55e82efa429e001dd6f2979d7f5d351 (diff)
downloadgrep-9fbc2fb1823c71a9d3370e0b04886c5994000fa8.tar.gz
tests: avoid false failures when run in qemu user mode
* tests/filename-lineno.pl: Derive the program name that grep will use in diagnostics, based on a suggestion from Assaf Gordon. * tests/in-eq-out-infloop: Similar: accept an arbitrary "command_name: " prefix on checked diagnostics, rather than requiring "grep: ". * tests/reversed-range-endpoints: Likewise. * tests/write-error-msg: Likewise. Reported by Bruno Haible in http://bugs.gnu.org/27532
Diffstat (limited to 'tests/filename-lineno.pl')
-rwxr-xr-xtests/filename-lineno.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/filename-lineno.pl b/tests/filename-lineno.pl
index 8eead57a..6cc86b79 100755
--- a/tests/filename-lineno.pl
+++ b/tests/filename-lineno.pl
@@ -24,6 +24,9 @@ use strict;
(my $program_name = $0) =~ s|.*/||;
my $prog = 'grep';
+my $full_prog_name = `$prog --no-such-option 2>&1`;
+$full_prog_name =~ s/:.*//s;
+$prog = $full_prog_name if $full_prog_name;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;