summaryrefslogtreecommitdiff
path: root/metadata/install-qa-check.d/60noop-testsuites
blob: 82e3de6b7ed3f16a4d32d5743f5b8f3651fc5a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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