diff --git a/Makefile b/Makefile index 97c8c85..7f70fa1 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ HELPERS := assert_device_present \ ensure_lib_firmware \ rproc-start \ rproc-stop \ + value_in_range \ state_check BOARDS := arrow,apq8096-db820c \ diff --git a/helpers/value_in_range b/helpers/value_in_range new file mode 100755 index 0000000..30f5ecb --- /dev/null +++ b/helpers/value_in_range @@ -0,0 +1,22 @@ +#!/bin/sh + +. bootrr + +TEST_CASE_ID="$1" +LOC="$2" +LOW="$3" +HIGH="$4" + +if [ -z "${TEST_CASE_ID}" -o -z "${LOC}" -o -z "${LOW}" -o -z "${HIGH}" ]; then + echo "Usage: $0 []" + exit 1 +fi + +[ -r "${LOC}" ] || test_report_exit fail + +val=$(cat "${LOC}") +if [ "${val}" -ge "${LOW}" -a "${val}" -le "${HIGH}" ]; then + test_report_exit pass +else + test_report_exit fail +fi