Skip to content

Commit

Permalink
test: remove always echo; echo errors as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed May 1, 2023
1 parent 17c698d commit af45366
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/run-vader-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ run_file="$(mktemp)"

function filter-vader-output() {
local hit_first_vader_line=0
local force_echo=0

while read -r; do
echo "$REPLY"
# Search for the first Vader output line.
if ((!hit_first_vader_line)); then
if [[ "$REPLY" = *'Starting Vader:'* ]]; then
Expand All @@ -31,10 +31,18 @@ function filter-vader-output() {
fi
fi

# If an error occured, make sure to print it.
if [[ "$REPLY" = *'Expected:'* ]]; then
force_echo=1
elif [[ "$REPLY" =~ \[[A-Z\ ]+\] ]]; then
force_echo=0
fi

if [[ "$REPLY" =~ \[[A-Z\ ]+\] ]] \
|| [[ "$REPLY" = *'Starting Vader:'* ]] \
|| [[ "$REPLY" = *'Success/Total'* ]] \
|| [[ "$REPLY" = *'Elapsed time:'* ]]
|| [[ "$REPLY" = *'Elapsed time:'* ]] \
|| [[ $force_echo = 1 ]]
then
echo "$REPLY"
fi
Expand Down

0 comments on commit af45366

Please sign in to comment.