Files
swupd-client/test/functional/check_ids.bash
William Douglas ffb1590909 Update shellcheck exceptions
Shellcheck changed its detection for a few file sourcing errors from
1090 to 1091. Update the disables accordingly.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00

34 lines
733 B
Bash
Executable File

#!/bin/bash
# shellcheck disable=SC1091
# SC1091: Not following, SC couldn't follow the dynamic path
# We already process that file, so it's fine to ignore
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_PATH/../functional/testlib.bash"
set -e
#Check if there's no dupicated test
list_tests --all| cut -f 1 -d ':'|sort -cu
last_lbl=""
last_num=0
for t in $(list_tests --all| cut -f 1 -d ':'|sort); do
lbl=$(echo "$t" | cut -b 1-3)
num=$(echo "$t" | cut -b 4-6)
if [ "$last_lbl" != "$lbl" ]; then
last_lbl="$lbl"
last_num=0
fi
last_num=$((last_num + 1))
if [ "$last_num" -ne "$num" ]; then
echo "Test $t has an incorrect number"
exit 1
fi
done
echo "All tests have valid IDs."
exit 0