From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202510 header.b=sHhiRT5O; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 89F595A061C for ; Thu, 09 Oct 2025 05:44:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1759981439; bh=l9NQ8ZDyx6tEOCid6PdIu1JG61crxl/YFlMLLAs/Bbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sHhiRT5OZqWyPVy2WRpPpb4PV1XS+1ApLi+Gld+/bMR8SA+ma6AB/DPe+ayqzLPKd Q6dTpOV/XKdOgnk8svlG4upN/MXeimfV2GHfOkH3p5YUHjuTVxrvqLzs9t7cMvMDuF eNJvfpjzvXXLnYu6HQz+8HiY6kkW17YyQYPf8FuDGHmTx2IBghbeSpS/4mCfO6noW3 h1BuSGbN5jzTUxVp5QMvopm5LQ+BhHbI4B+XqT+JecKMnIlAEqg1Cw2jaALHMXLnkO y+cNW0XD7kGJ2ekUEWKfVdqAUhtOpX0KnTJbntM8+vSyaIFIjlK8jq5gwwXdBQk22y Eh6Dg3kjAyeng== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4chwhv56jVz4wCp; Thu, 9 Oct 2025 14:43:59 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 2/2] test: For missing static checkers, skip rather than failing tests Date: Thu, 9 Oct 2025 14:43:58 +1100 Message-ID: <20251009034358.1256908-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251009034358.1256908-1-david@gibson.dropbear.id.au> References: <20251009034358.1256908-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: W3JTKUY2HL2GTZ33PDKRA5Y6HYYEU2SM X-Message-ID-Hash: W3JTKUY2HL2GTZ33PDKRA5Y6HYYEU2SM X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We run a bunch of static checkers as part of our testsuite. That's useful, but it means that if a user doesn't have one of them installed, it fails the entire testsuite. Alter our scripts to skip the test, rather than failing outright if the checker tool is not installed. This requires exeter v0.4.4 or later. Signed-off-by: David Gibson --- test/build/static_checkers.sh | 17 +++++++++++++---- test/lib/exeter | 10 +++++++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/test/build/static_checkers.sh b/test/build/static_checkers.sh index 228b99ae..caccd183 100755 --- a/test/build/static_checkers.sh +++ b/test/build/static_checkers.sh @@ -15,16 +15,25 @@ . $(dirname $0)/../exeter/sh/exeter.sh -exeter_register cppcheck make -C .. cppcheck +do_check() { + checker="$1" + shift + if ! which "${checker}"; then + exeter_skip "${checker} not available" + fi + make "${@}" "${checker}" +} + +exeter_register cppcheck do_check cppcheck -C .. exeter_set_description cppcheck "passt sources pass cppcheck" -exeter_register clang_tidy make -C .. clang-tidy +exeter_register clang_tidy do_check clang-tody -C .. exeter_set_description clang_tidy "passt sources pass clang-tidy" -exeter_register flake8 make flake8 +exeter_register flake8 do_check flake8 exeter_set_description flake8 "passt tests in Python pass flake8" -exeter_register mypy make mypy +exeter_register mypy do_check mypy exeter_set_description mypy "passt tests in Python pass mypy --strict" exeter_main "$@" diff --git a/test/lib/exeter b/test/lib/exeter index 530c6909..6ed92a16 100644 --- a/test/lib/exeter +++ b/test/lib/exeter @@ -49,7 +49,15 @@ exeter() { for __testid in $($EXETOOL list -- "$@"); do __desc="$($EXETOOL desc -- "$@" -- "${__testid}")" status_test_start "${__desc}" - context_run host "$* '${__testid}'" && status_test_ok || status_test_fail + status=0 + context_run host "$* '${__testid}'" || status="$?" + if [ "$status" = 0 ]; then + status_test_ok + elif [ "$status" = 77 ]; then + status_test_skip + else + status_test_fail + fi done cd .. -- 2.51.0