summaryrefslogtreecommitdiff
path: root/common/scripts/send-to-lava.sh
blob: fd9a40bc006c4ac16f68dc51bf8b5b864ca4dc4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

RESULT_FILE="$1"

while read line; do
    if echo "${line}" | egrep -q ".* +(pass|fail|skip)$"; then
        test="$(echo "${line}" | awk '{print $1}')"
        result="$(echo "${line}" | awk '{print $2}')"
        lava-test-case "${test}" --result "${result}"
    elif echo "${line}" | egrep -q ".* +(pass|fail|skip) +[0-9.E-]+ [A-Za-z./]+$"; then
        test="$(echo "${line}" | awk '{print $1}')"
        result="$(echo "${line}" | awk '{print $2}')"
        measurement="$(echo "${line}" | awk '{print $3}')"
        units="$(echo "${line}" | awk '{print $4}')"
        lava-test-case "${test}" --result "${result}" --measurement "${measurement}" --units "${units}"
    fi
done < "${RESULT_FILE}"