summaryrefslogtreecommitdiff
path: root/infra/commands
diff options
context:
space:
mode:
authorDmitriy Nikiforov <d.nikiforov@samsung.com>2017-10-31 14:23:15 +0300
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2017-11-07 12:33:57 +0000
commit19d1de68cbe5d5a4392e49353de22fabb8a60d46 (patch)
tree3916f16b54078ba74c9ef1afe9a4ffc89c57f84a /infra/commands
parent9015879cc8ad4720f683431c11f77f90db2a317a (diff)
downloadfuzz-testing-19d1de68cbe5d5a4392e49353de22fabb8a60d46.tar.gz
fuzz-testing-19d1de68cbe5d5a4392e49353de22fabb8a60d46.tar.bz2
fuzz-testing-19d1de68cbe5d5a4392e49353de22fabb8a60d46.zip
Fix UBSan errors counter in the 'report' command script
Count number of matches instead of words in every matched line. Also, changed [CRASH] label to less confusing [FAILED]. Change-Id: I7bfdbcfc1de5deafba543824563905c36f91866b
Diffstat (limited to 'infra/commands')
-rwxr-xr-xinfra/commands/report.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/infra/commands/report.sh b/infra/commands/report.sh
index 928ec3a..d9897fd 100755
--- a/infra/commands/report.sh
+++ b/infra/commands/report.sh
@@ -112,11 +112,12 @@ for i in "${!logs[@]}"; do
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"