summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-10-16 17:36:43 +0000
committerMike Frysinger <vapier@gentoo.org>2014-10-16 17:36:43 +0000
commitf251bc4897f64085457b856cf0be071448057103 (patch)
treefb9a0c0b27068cbecc94f3657b079fca4d14767d /eclass/tests
parentChanging to using upstream supplied systemd files, fixing bug #525436 (diff)
downloadhistorical-f251bc4897f64085457b856cf0be071448057103.tar.gz
historical-f251bc4897f64085457b856cf0be071448057103.tar.bz2
historical-f251bc4897f64085457b856cf0be071448057103.zip
tests: let overlays add their own eclasses and testsuites and reuse this infrastructure
Diffstat (limited to 'eclass/tests')
-rw-r--r--eclass/tests/tests-common.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index 99712f68b864..131b78720834 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -5,11 +5,21 @@ if ! source /etc/init.d/functions.sh ; then
exit 1
fi
+# Let overlays override this so they can add their own testsuites.
+TESTS_ECLASS_SEARCH_PATHS=( .. )
+
inherit() {
- local e
+ local e path
for e in "$@" ; do
- source ../${e}.eclass
+ for path in "${TESTS_ECLASS_SEARCH_PATHS[@]}" ; do
+ local eclass=${path}/${e}.eclass
+ if [[ -e "${eclass}" ]] ; then
+ source "${eclass}"
+ return 0
+ fi
+ done
done
+ die "could not find ${eclass}"
}
EXPORT_FUNCTIONS() { :; }