diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2018-08-29 17:25:58 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2018-08-29 17:25:58 +0300 |
commit | 5e4f3af9b7b7ad46dae09d5020f9147cadffc14e (patch) | |
tree | ff586561ba8af6baae83de16c1432dae62f53452 /mysql-test/include | |
parent | 3d2c0f61e71adb80b914e9b87e57be90cb881def (diff) | |
download | mariadb-git-5e4f3af9b7b7ad46dae09d5020f9147cadffc14e.tar.gz |
MyRocks: post-merge fixes part #5: make rocksdb.rocksdb_checksums test pass
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/search_pattern_in_file.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc index 21192b55efb..6bead628fb0 100644 --- a/mysql-test/include/search_pattern_in_file.inc +++ b/mysql-test/include/search_pattern_in_file.inc @@ -18,6 +18,11 @@ # Optionally, SEARCH_ABORT can be set to "FOUND" or "NOT FOUND" and this # will abort if the search result doesn't match the requested one. # +# Optionally, SEARCH_OUTPUT can be set to control the format of output. +# Supported formats: +# - (default) : "FOUND n /pattern/ in FILE " or "NOT FOUND ..." +# - "matches" : Each match is printed, on a separate line +# # In case of # - SEARCH_FILE and/or SEARCH_PATTERN is not set # - SEARCH_FILE cannot be opened @@ -75,7 +80,14 @@ perl; my @matches=($content =~ m/$search_pattern/gs); my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND"; $ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1}; - print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n"; + + if ($ENV{SEARCH_OUTPUT} eq "matches") { + foreach (@matches) { + print $_ . "\n"; + } + } else { + print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n"; + } die "$ENV{SEARCH_ABORT}\n" - if $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/; + if $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/; EOF |