Skip to content

Commit a602171

Browse files
committed
tests: build: tools: check for untracked files
We seem to often miss adding outputs to gitignore. Try to catch those. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5ac1b1e commit a602171

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/patch/build_tools/build_tools.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ make O=$output_dir $build_flags -C tools/testing/selftests/ \
5555

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

58+
pr "Checking if tree is clean"
59+
git status -s 1>&2
60+
incumbent_dirt=$(git status -s | grep -c '^??')
61+
5862
pr "Building the tree with the patch"
5963
git checkout -q $HEAD
6064

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

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

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

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

96+
if [ $current_dirt -gt $incumbent_dirt ]; then
97+
echo "New untracked files added" 1>&2
98+
99+
rc=1
100+
fi
101+
88102
rm $tmpfile_o $tmpfile_n
89103

90104
exit $rc

0 commit comments

Comments
 (0)