From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A7B5C433F5 for ; Tue, 14 Dec 2021 18:38:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46E508310B; Tue, 14 Dec 2021 19:37:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 419208203C; Tue, 14 Dec 2021 19:37:04 +0100 (CET) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3744882F03 for ; Tue, 14 Dec 2021 19:36:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qv1-f52.google.com with SMTP id gu12so18096025qvb.6 for ; Tue, 14 Dec 2021 10:36:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lVu1uT+IXH43OWWqlmohXgHBHaM2Afzll7SC/Wk9scs=; b=y0NV72Y3/Ti/oFy0ratQ4ql94fCm5cf0ixwDOS2eoQhIN8eFY6i6aWD95SB+1byMpB 90FEoxSKWMkYc8IGIaNOoj6I4NG7HyRHtq3jXSXUFKKnGc98K6Kqumccbk1+54TWF4bY Vbo70ZGhkianFZvA1VOcN+o1OFYZCr20lhyltOgfmXmZfVX0H+0Dv7pesR1dMViS3fH4 LdyPfY3h1J2dsH23/B8M79lSfL4JFvXTqoIMnes/IUARLlxIJDx0O3GXBDa3jIiJIPZ9 CU6zNB1jscT16lmIkvKE9MPD89y1rC+vee7/3Xnlfkp37P8ke+GruZuGFpQB3XSu3PMZ z0Zg== X-Gm-Message-State: AOAM530hxS0o9y+mYx7FRw60pZrjn4yrAdmsaT+rkrZj1pQotkkH8dfq jMWbj0vWPdqVG5RoEKDc38SC8tLa3A== X-Google-Smtp-Source: ABdhPJz16y/vjewhS+kfx7tmt2Wv+SN0e4H1Z69Nvwhe5ZpxGoEKtRt2PTSmFTTT/YMVVO5eClanrw== X-Received: by 2002:a05:6214:1453:: with SMTP id b19mr7356727qvy.20.1639507008855; Tue, 14 Dec 2021 10:36:48 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-310c-c3b6-cb4e-9c9e.res6.spectrum.com. [2603:6081:7b01:cbda:310c:c3b6:cb4e:9c9e]) by smtp.gmail.com with ESMTPSA id b11sm498795qtx.85.2021.12.14.10.36.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Dec 2021 10:36:48 -0800 (PST) From: Tom Rini 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 Message-Id: <20211214183641.1877371-9-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214183641.1877371-1-trini@konsulko.com> References: <20211214183641.1877371-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- .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