public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ryan Hill <dirtyepic@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev]  Re: controlling src_test
Date: Thu, 04 Oct 2007 13:47:52 -0600	[thread overview]
Message-ID: <fe3g18$8q7$1@sea.gmane.org> (raw)
In-Reply-To: <fe38gb$9t0$1@sea.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

Ryan Hill wrote:
> Rémi Cardona wrote:
>> Ravi Pinjala a écrit :
>>> I, for one, would like to be able to control whether or not to run tests
>>> that take a huge amount of time to run. Some test suites are
>>> ridiculously comprehensive, and if we could have an option to disable
>>> only those, or even run a reduced test suite, that'd be pretty neat.
>> We've already had this discussion before [1] and there is no
>> one-size-fits-all solution for tagging tests.
>>
>> Ryan's plan only proposes to enable/disable tests based on whether they
>> can run inside a sandbox. That much is doable. Trying to quantify the
>> time a test suite will take to complete is impossible : different
>> arches, vastly different CPU clock speeds, same for HDDs sizes and
>> speeds, ... is impossible.
> 
> I usually disable tests on a per-package basis using /etc/portage/env
> entries.
> 
> dirtyepic@tycho ~ $ cat /etc/portage/env/sci-libs/fftw
> NEWFEATURES=
> 
> for f in ${FEATURES}; do
>     if [[ ! $f == "test" ]]; then
>         NEWFEATURES="${NEWFEATURES} $f"
>     fi
> done
> 
> FEATURES="${NEWFEATURES}"

here's a crappy little script to automate it.

-- 
                  fonts / wxWindows / gcc-porting / treecleaners
  EFFD 380E 047A 4B51 D2BD  C64F 8AA8 8346 F9A4 0662 (0xF9A40662)

[-- Attachment #2: defeature --]
[-- Type: text/plain, Size: 1457 bytes --]

#!/bin/bash -
#
# defeature - disable a FEATURE on a per-package basis.
#
# <dirtyepic@gentoo.org>

source /usr/lib/portage/bin/isolated-functions.sh

defeature() {
	if [[ ! $# -eq 2 ]]; then
		echo
		eerror "Usage:  $(basename $0) <FEATURE> <pkgname>"
		echo
		exit 1
	fi

	local pkgcat pkgname

	pkgcat=${!#%%/*}
	pkgname=${!###/*}

	if [[ $(equery w =${pkgname} 2>&1 | grep "No masked" ) ]]; then
		echo
		eerror "No package found matching \"${pkgname}\"."
		echo
		exit 1
	fi

	[[ $pkgcat == $pkgname ]] && pkgcat=

	if [[ -z ${pkgcat} ]]; then

		# Need a better way to get category - use udept for now

		# check for ambiguous package names
		if [[ $(dep -1c ${pkgname} | awk 'END { print NR }') -gt 1 ]]; then
			echo
			eerror "Found multiple categories for \"${pkgname}\"."
			eerror "Please use a fully qualified package name (cat/package)."
			echo
			exit 1
		fi

		pkgcat="$(dep -1c ${pkgname})"
	    # strip whitespace
		pkgcat="${pkgcat// /}"
	fi

	[[ ! -d /etc/portage/env/${pkgcat} ]] \
		&& sudo mkdir -p /etc/portage/env/${pkgcat}

	# note that this overwrites anything already in the file
	cat > /etc/portage/env/${pkgcat}/${pkgname} <<-EOF
		NEWFEATURES=

		for f in \${FEATURES}; do
		    if [[ ! \$f == "${1}" ]]; then
				NEWFEATURES="\${NEWFEATURES} \$f"
			fi
		done

		FEATURES="\${NEWFEATURES}"
	EOF

	if [[ $? -eq 0 ]]; then
		echo
		einfo "${1} FEATURE disabled for ${pkgcat}/${pkgname}."
		echo
	fi

	exit 0
}

defeature "$@"

  reply	other threads:[~2007-10-04 21:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04  1:50 [gentoo-dev] controlling src_test Ryan Hill
2007-10-04  6:51 ` Ravi Pinjala
2007-10-04 13:36   ` Doug Goldstein
2007-10-04 14:36     ` Thomas Anderson
2007-10-04 14:51   ` Rémi Cardona
2007-10-04 17:39     ` [gentoo-dev] " Ryan Hill
2007-10-04 19:47       ` Ryan Hill [this message]
2007-10-04 21:10         ` Chris Gianelloni
2007-10-04 21:18         ` Rémi Cardona
2007-10-05  1:34         ` Ryan Hill
2007-10-04 20:31       ` Alin Năstac
2007-10-04 21:16         ` Ryan Hill
2007-10-04 23:14 ` [gentoo-dev] " Marius Mauch
2007-10-04 23:32   ` Bo Ørsted Andresen

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='fe3g18$8q7$1@sea.gmane.org' \
    --to=dirtyepic@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox