37 lines
1,012 B
Bash
Executable file
37 lines
1,012 B
Bash
Executable file
#!/bin/bash
|
|
|
|
RETVAL=0
|
|
|
|
DELIMITER='=============================================================================='
|
|
|
|
echo -e "\n${DELIMITER}\nChecking WITH_SCL in tests' main.fmf\n"
|
|
|
|
# shellcheck disable=SC2044
|
|
for i in $(find . -name main.fmf); do
|
|
[ "$i" = "./tests/dts-probe-binaries/main.fmf" ] && continue
|
|
|
|
if grep -q '^test:.*test\.sh' "$i"; then
|
|
# shellcheck disable=SC2016
|
|
if ! grep -qF 'test: "$WITH_SCL ./test.sh"' "$i"; then
|
|
echo "$i does not use WITH_SCL in 'test:'"
|
|
RETVAL=1
|
|
fi
|
|
fi
|
|
done
|
|
echo "$DELIMITER"
|
|
|
|
echo -e "\n${DELIMITER}\nChecking for '!=' and ',' used together\n"
|
|
|
|
# shellcheck disable=SC2044
|
|
for i in $(find . -name '*.fmf' -type f); do
|
|
if grep -qE 'when:.*!=\s*[a-z0-9_]+,' "$i"; then
|
|
echo "$i uses '!=' and ',' together in 'when:'"
|
|
grep -E 'when:.*!=\s*[a-z0-9_]+,' "$i"
|
|
RETVAL=1
|
|
fi
|
|
done
|
|
echo "$DELIMITER"
|
|
|
|
echo -en "\nOVERALL RESULT: "
|
|
[[ "$RETVAL" -eq 0 ]] && echo PASS || echo FAIL
|
|
exit $RETVAL
|