All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH 9/9] CI: Test for unmigrated CONFIG symbols in board config.h files
Date: Tue, 14 Dec 2021 13:36:41 -0500	[thread overview]
Message-ID: <20211214183641.1877371-9-trini@konsulko.com> (raw)
In-Reply-To: <20211214183641.1877371-1-trini@konsulko.com>

Now that all symbols that exist in Kconfig no longer also have boards
setting them  in the board config.h file, add a CI test to catch new
instances of this, and fail.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 .azure-pipelines.yml | 27 +++++++++++++++++++++++++++
 .gitlab-ci.yml       | 21 +++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 8801ff7d81b3..31c2ac87e08d 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -49,6 +49,33 @@ jobs:
             -j$(sysctl -n hw.logicalcpu)
         displayName: 'Perform tools-only build'
 
+  - job: check_for_migrated_symbols_in_board_header
+    displayName: 'Check for migrated symbols in board header'
+    pool:
+      vmImage: $(ubuntu_vm)
+    container:
+      image: $(ci_runner_image)
+      options: $(container_option)
+    steps:
+      - script: |
+          KSYMLST=`mktemp`
+          KUSEDLST=`mktemp`
+          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 include/configs/*.h; do
+             grep '#define[[:blank:]]CONFIG_' $CFG | \
+                sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' | \
+                sort -u > ${KUSEDLST} || true
+             NUM=`comm -12 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | \
+                cut -d , -f 3`
+             if [[ $NUM -ne 0 ]]; then
+                echo "Unmigrated symbols found in $CFG"
+                exit 1
+             fi
+          done
+
   - job: cppcheck
     displayName: 'Static code analysis with cppcheck'
     pool:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4c89daeadcf3..b5287779230e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -105,6 +105,27 @@ build all other platforms:
         exit $ret;
       fi;
 
+check for migrated symbols in board header:
+  stage: testsuites
+  script:
+    - KSYMLST=`mktemp`;
+      KUSEDLST=`mktemp`;
+      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 include/configs/*.h; do
+         grep '#define[[:blank:]]CONFIG_' $CFG |
+            sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' |
+            sort -u > ${KUSEDLST} || true;
+         NUM=`comm -12 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} |
+            cut -d , -f 3`;
+         if [[ $NUM -ne 0 ]]; then
+            echo "Unmigrated symbols found in $CFG";
+            exit 1;
+         fi;
+      done
+
 # QA jobs for code analytics
 # static code analysis with cppcheck (we can add --enable=all later)
 cppcheck:
-- 
2.25.1


  parent reply	other threads:[~2021-12-14 18:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 18:36 [PATCH 1/9] Convert CONFIG_TPL_TEXT_BASE to Kconfig Tom Rini
2021-12-14 18:36 ` [PATCH 2/9] Convert CONFIG_SYS_NAND_U_BOOT_OFFS " Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-14 18:36 ` [PATCH 3/9] Convert CONFIG_ARCH_MAP_SYSMEM " Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-14 18:36 ` [PATCH 4/9] arm: s5pc1xx: Move CONFIG_SYS_CLK_FREQ_C1x0 out of CONFIG namespace Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-14 18:36 ` [PATCH 5/9] ls1088a: Guard get_board_ddr_clk function correctly Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-14 18:36 ` [PATCH 6/9] nxp: ics307_clk: " Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-14 18:36 ` [PATCH 7/9] CONFIG_SYS_CLK_FREQ: Consistently be static or get_board_sys_clk() Tom Rini
2021-12-28 12:57   ` Tom Rini
2021-12-14 18:36 ` [PATCH 8/9] Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig Tom Rini
2021-12-28 12:58   ` Tom Rini
2021-12-14 18:36 ` Tom Rini [this message]
2021-12-28 12:58   ` [PATCH 9/9] CI: Test for unmigrated CONFIG symbols in board config.h files Tom Rini
2021-12-28 12:57 ` [PATCH 1/9] Convert CONFIG_TPL_TEXT_BASE to Kconfig Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211214183641.1877371-9-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.