aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2012-09-09 00:33:00 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2012-09-09 00:33:00 +0100
commit973da69b343a263d44d45ff1a7831d42d32c22a8 (patch)
tree7609d0ff76eafb5a76ff4f13003667531a318d3c
parentc4ba9866a1f4c7474befb0cdfe894494a6d5b19b (diff)
downloadpaludis-973da69b343a263d44d45ff1a7831d42d32c22a8.tar.gz
paludis-973da69b343a263d44d45ff1a7831d42d32c22a8.tar.xz
Don't force -j1 for EAPI 5 default src_test
-rw-r--r--paludis/repositories/e/ebuild/5/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/5/src_test.bash89
2 files changed, 90 insertions, 0 deletions
diff --git a/paludis/repositories/e/ebuild/5/Makefile.am b/paludis/repositories/e/ebuild/5/Makefile.am
index 99d227d..fbcb919 100644
--- a/paludis/repositories/e/ebuild/5/Makefile.am
+++ b/paludis/repositories/e/ebuild/5/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = .
libexecprog5dir = $(libexecdir)/paludis/5
libexecprog5_SCRIPTS = \
+ src_test.bash \
usex.bash \
output_functions.bash
diff --git a/paludis/repositories/e/ebuild/5/src_test.bash b/paludis/repositories/e/ebuild/5/src_test.bash
new file mode 100644
index 0000000..de0f5fd
--- /dev/null
+++ b/paludis/repositories/e/ebuild/5/src_test.bash
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2008 David Leverton
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+default_src_test()
+{
+ if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
+ echo "Makefile found, looking for potential test targets"
+ if make -j1 -n check ; then
+ echo "Found check target"
+ emake check || die "make check failed"
+ elif make -j1 -n test ; then
+ echo "Found test target"
+ emake test || die "make test failed"
+ else
+ echo "No check or test target, skipping tests"
+ fi
+ else
+ echo "No Makefile, skipping tests"
+ fi
+}
+
+src_test()
+{
+ default_src_test
+}
+
+ebuild_f_test()
+{
+ local old_sandbox_predict="${SANDBOX_PREDICT}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}/"
+
+ local save_PALUDIS_EXTRA_DIE_MESSAGE="${PALUDIS_EXTRA_DIE_MESSAGE}"
+ export PALUDIS_EXTRA_DIE_MESSAGE="
+!!! This package failed inside the test phase. You should read
+!!! http://paludis.exherbo.org/faq/stricter.html#testfailures
+!!! for more information on packages with test phase failures.
+"
+
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "test" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_test (SKIP_FUNCTIONS)"
+ else
+ if [[ $(type -t pre_src_test ) == "function" ]] ; then
+ ebuild_section "Starting pre_src_test"
+ pre_src_test
+ ebuild_section "Done pre_src_test"
+ fi
+
+ ebuild_section "Starting src_test"
+ src_test
+ ebuild_section "Done src_test"
+
+ if [[ $(type -t post_src_test ) == "function" ]] ; then
+ ebuild_section "Starting post_src_test"
+ post_src_test
+ ebuild_section "Done post_src_test"
+ fi
+ fi
+
+ export PALUDIS_EXTRA_DIE_MESSAGE="${save_PALUDIS_EXTRA_DIE_MESSAGE}"
+
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_PREDICT="${old_sandbox_predict}"
+ true
+}
+