public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] metadata/install-qa-check.d: add 60noop-testsuites
@ 2022-08-14 22:03 matoro
  0 siblings, 0 replies; only message in thread
From: matoro @ 2022-08-14 22:03 UTC (permalink / raw
  To: Gentoo Dev

This attempts to catch autotools-based tests that will pass without
actually executing any tests due to automagic-based rules like the
presence/absence of a dependency.

Bug: https://bugs.gentoo.org/848579
---
  metadata/install-qa-check.d/60noop-testsuites | 28 +++++++++++++++++++
  1 file changed, 28 insertions(+)
  create mode 100644 metadata/install-qa-check.d/60noop-testsuites

diff --git a/metadata/install-qa-check.d/60noop-testsuites 
b/metadata/install-qa-check.d/60noop-testsuites
new file mode 100644
index 0000000000..82e3de6b7e
--- /dev/null
+++ b/metadata/install-qa-check.d/60noop-testsuites
@@ -0,0 +1,28 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# QA check: look for autotools-based tests are actually no-ops
+# Maintainer: Quality Assurance team <qa@gentoo.org>
+
+noop_testsuite_check() {
+    use test || return
+
+    IFS= readarray -t noop_testsuites < <(find "${S}" -type f -name 
'test-suite.log' -print0 | xargs -0 grep -l "TOTAL: 0" 2>/dev/null)
+
+    if [[ -n ${noop_testsuites[@]} ]]; then
+        eqawarn "QA Notice: Test suite passed but did not actually 
execute any tests:"
+        eqawarn
+        for suite in ${noop_testsuites[@]}
+        do
+            # can't use eqatag here because filenames must be relative 
to ${D},
+            # but our test suite log files only exist in ${S}
+            eqawarn "\t${suite#${S}/}"
+        done
+        eqawarn
+    fi
+}
+
+noop_testsuite_check
+: # guarantee successful exit
+
+# vim:ft=sh
-- 
2.35.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-14 22:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-14 22:03 [gentoo-dev] [PATCH] metadata/install-qa-check.d: add 60noop-testsuites matoro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox