File tree 1 file changed +9
-25
lines changed 1 file changed +9
-25
lines changed Original file line number Diff line number Diff line change @@ -116,42 +116,26 @@ ($$$$$)
116
116
} else {
117
117
my $r ;
118
118
119
- my $dir = getcwd();
120
- my $abs_path = " $dir /$name /$output " ;
121
- open (my $fh => $abs_path ) || die " Cannot open '$name /$output ': $! " ;
122
-
123
119
# Multi line therefore we run each check across the whole output
124
120
if ($grep_options eq " activate-multi-line-match" ) {
121
+ my $dir = getcwd();
122
+ my $abs_path = " $dir /$name /$output " ;
123
+ open (my $fh => $abs_path ) || die " Cannot open '$name /$output ': $! " ;
124
+
125
125
local $/ = undef ;
126
126
binmode $fh ;
127
127
my $whole_file = <$fh >;
128
128
my $is_match = $whole_file =~ / $result / ;
129
129
$r = ($included ? !$is_match : $is_match );
130
+ close ($fh );
130
131
}
131
132
else
132
133
{
133
- my $found_line = 0;
134
- while (my $line = <$fh >) {
135
- if ($line =~ / $result / ) {
136
- # We've found the line, therefore if it is included we set
137
- # the result to 0 (OK) If it is excluded, we set the result
138
- # to 1 (FAILED)
139
- $r = !$included ;
140
- $found_line = 1;
141
- last ;
142
- }
143
- }
144
-
145
- if ($found_line == 0) {
146
- # None of the lines matched, therefore the result is set to
147
- # 0 (OK) if and only if the line was not meant to be included
148
- $r = $included ;
149
- }
150
-
134
+ $result =~ s /\\ / \\\\ / g ;
135
+ $result =~ s / ([^\\ ])\$ / $1 \\ r\\\\ ?\$ / ;
136
+ system (" bash" , " -c" , " grep \$ '$result ' '$name /$output ' >/dev/null" );
137
+ $r = ($included ? $? != 0 : $? == 0);
151
138
}
152
- close ($fh );
153
-
154
-
155
139
if ($r ) {
156
140
print LOG " $result [FAILED]\n " ;
157
141
$failed = 1;
You can’t perform that action at this time.
0 commit comments