Skip to content

Commit c63a1ca

Browse files
committed
Add a script and CI action for tests/allheaders.h
Check that all headers are either #included or mentioned in tests/allheaders.h.
1 parent 4c5dff9 commit c63a1ca

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/code_checks.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,15 @@ jobs:
101101
echo "::error ::Please use C++11 equivalents of the deprecated macros in the new code."
102102
exit 1
103103
fi
104+
105+
check-allheaders:
106+
runs-on: ubuntu-20.04
107+
name: Check All Headers In allheaders.h
108+
109+
steps:
110+
- name: Checkout
111+
uses: actions/checkout@v4
112+
113+
- name: Check that all headers are listed in tests/allheaders.h
114+
run: |
115+
./misc/scripts/check_allheaders.sh

misc/scripts/check_allheaders.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
cd $(dirname "$0")/../..
4+
5+
rc=0
6+
7+
for h in include/wx/*.h ; do
8+
header=wx/$(basename "$h")
9+
if ! grep -q "$header" tests/allheaders.h ; then
10+
echo "ERROR - <$header> not present in tests/allheaders.h"
11+
rc=$((rc+1))
12+
fi
13+
done
14+
15+
exit $rc

0 commit comments

Comments
 (0)