summaryrefslogtreecommitdiff
path: root/automated/utils
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2016-10-21 09:00:15 +0800
committerNaresh Kamboju <naresh.kamboju@linaro.org>2016-10-24 03:37:29 +0000
commitc1a3f8840ba967cc70ac6a55537a5b594f1fbe0b (patch)
tree1f66956a4061d64219fc0538382422c28e7ace4a /automated/utils
parent191ede503851687f7694192ee1f47d5516a75a3b (diff)
v2: send-to-lava.sh: move 'command -v' out of while loop
Change-Id: Iff916da54cee93664f24bcdd1c14970b5a5db984 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/utils')
-rwxr-xr-xautomated/utils/send-to-lava.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/automated/utils/send-to-lava.sh b/automated/utils/send-to-lava.sh
index 2764853..ddd7a36 100755
--- a/automated/utils/send-to-lava.sh
+++ b/automated/utils/send-to-lava.sh
@@ -2,13 +2,16 @@
RESULT_FILE="$1"
+command -v lava-test-case
+lava_test_case="$?"
+
if [ -f "${RESULT_FILE}" ]; then
while read line; do
if echo "${line}" | egrep -iq ".* +(pass|fail|skip)$"; then
test="$(echo "${line}" | awk '{print $1}')"
result="$(echo "${line}" | awk '{print $2}')"
- if command -v lava-test-case; then
+ if [ "${lava_test_case}" -eq 0 ]; then
lava-test-case "${test}" --result "${result}"
else
echo "<TEST_CASE_ID=${test} RESULT=${result}>"
@@ -19,7 +22,7 @@ if [ -f "${RESULT_FILE}" ]; then
measurement="$(echo "${line}" | awk '{print $3}')"
units="$(echo "${line}" | awk '{print $4}')"
- if command -v lava-test-case; then
+ if [ "${lava_test_case}" -eq 0 ]; then
lava-test-case "${test}" --result "${result}" --measurement "${measurement}" --units "${units}"
else
echo "<TEST_CASE_ID=${test} RESULT=${result} UNITS=${units} MEASUREMENT=${measurement}>"