ladybird/Meta/check-ak-test-files.sh
Brian Gianforcaro 7e28ecc305 Meta + Lagom: Fix paths after movement of tests to Tests/
Not sure how this didn't cause a build break when I originally
moved them in #6891. Better fix them now.
2021-05-08 00:04:10 +01:00

26 lines
746 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "${script_path}/.."
MISSING_FILES=n
while IFS= read -r FILENAME; do
# Simply search whether the CMakeLists.txt *ever* mention the test files.
if ! grep -qP "${FILENAME}" AK/Tests/CMakeLists.txt ; then
echo "Tests/AK/CMakeLists.txt is missing the test file ${FILENAME}"
MISSING_FILES=y
fi
done < <(
git ls-files 'Test/AK/Test*.cpp' | xargs -i basename {}
)
if [ "n" != "${MISSING_FILES}" ] ; then
echo "Some files are missing from the AK/Tests/CMakeLists.txt."
echo "If a new test file is being added, ensure it is in the CMakeLists.txt."
echo "This ensures the new tests are always run."
exit 1
fi