diff options
author | Tom Rini <trini@konsulko.com> | 2022-12-04 10:14:15 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-12-23 13:01:12 -0500 |
commit | bb9b9c1e207744fc2ea5163688e9379530a3057b (patch) | |
tree | 999c3d4f13c6c75591b325801bb9781f12dde0a4 /.gitlab-ci.yml | |
parent | 2a06da08e7897deb08c204df1c2f7853c4e61806 (diff) | |
download | u-boot-bb9b9c1e207744fc2ea5163688e9379530a3057b.tar.gz |
CI: Replace unmigrated symbol test with non-Kconfig introduction test
Now that all symbols have been migrated to Kconfig, or are part of the
CFG namespace we do not need a complex check for unmigrated CONFIG
symbols. Any instance of #define (or #undef) or a CONFIG value is wrong,
so cause CI to fail.
This test is not as strict as possible yet as we have more symbols that
were not previously caught to deal with.
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e14b57a5e0b..afd83948c1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -124,31 +124,14 @@ build all other platforms: exit $ret; fi; -check for migrated symbols in board header: +check for new CONFIG symbols outside Kconfig: stage: testsuites script: - - KSYMLST=`mktemp`; - KUSEDLST=`mktemp`; - RET=0; - cat `find . -name "Kconfig*"` | - sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' - -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' - | sort -u > $KSYMLST; - for CFG in `find include/configs -name "*.h"`; do - (grep '#define[[:blank:]]CONFIG_' $CFG | - sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' ; - grep '#undef[[:blank:]]CONFIG_' $CFG | - sed -n 's/#undef.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p') | - sort -u > ${KUSEDLST} || true; - NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | - cut -d , -f 3`; - if [[ $NUM -ne 0 ]]; then - echo "Unmigrated symbols found in $CFG:"; - comm -12 ${KSYMLST} ${KUSEDLST}; - RET=1; - fi; - done; - exit $RET + - git config --global --add safe.directory "${CI_PROJECT_DIR}" + # If grep succeeds and finds a match the test fails as we should + # have no matches. + - git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_' + include/configs `find arch -name config.h` && exit 1 || exit 0 # QA jobs for code analytics # static code analysis with cppcheck (we can add --enable=all later) |