Skip to content

Commit

Permalink
tests: build: tools: check for untracked files
Browse files Browse the repository at this point in the history
We seem to often miss adding outputs to gitignore.
Try to catch those.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Oct 4, 2024
1 parent 5ac1b1e commit a602171
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/patch/build_tools/build_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ make O=$output_dir $build_flags -C tools/testing/selftests/ \

incumbent=$(grep -i -c "\(warn\|error\)" $tmpfile_o)

pr "Checking if tree is clean"
git status -s 1>&2
incumbent_dirt=$(git status -s | grep -c '^??')

pr "Building the tree with the patch"
git checkout -q $HEAD

Expand All @@ -64,7 +68,11 @@ make O=$output_dir $build_flags -C tools/testing/selftests/ \

current=$(grep -i -c "\(warn\|error\)" $tmpfile_n)

echo "Errors and warnings before: $incumbent this patch: $current" >&$DESC_FD
pr "Checking if tree is clean"
git status -s 1>&2
current_dirt=$(git status -s | grep -c '^??')

echo "Errors and warnings before: $incumbent (+$incumbent_dirt) this patch: $current (+$current_dirt)" >&$DESC_FD

if [ $current -gt $incumbent ]; then
echo "New errors added" 1>&2
Expand All @@ -85,6 +93,12 @@ if [ $current -gt $incumbent ]; then
rc=1
fi

if [ $current_dirt -gt $incumbent_dirt ]; then
echo "New untracked files added" 1>&2

rc=1
fi

rm $tmpfile_o $tmpfile_n

exit $rc

0 comments on commit a602171

Please sign in to comment.