Count number of matches instead of words in every matched line.
Also, changed [CRASH] label to less confusing [FAILED].
Change-Id: I7bfdbcfc1de5deafba543824563905c36f91866b
done
# get UBSan errors
- ubsan_errors=($(grep "runtime error" "${run_dir}/${symbolized}" || :))
+ # ignore error codes from grep - it returns non-zero code if it does not find any matches
+ ubsan_errors=$(grep -c "runtime error" "${run_dir}/${symbolized}" || true)
- if (( ${#crash_inputs[@]} + ${#ubsan_errors[@]} > 0 )); then
- (( errors_num += ${#crash_inputs[@]} + ${#ubsan_errors[@]} ))
- printf_err " [CRASH]"
+ if (( ${#crash_inputs[@]} + ubsan_errors > 0 )); then
+ (( errors_num += ${#crash_inputs[@]} + ubsan_errors ))
+ printf_err " [FAILED]"
fi
printf_err "\n"