vapier 14/10/16 17:36:43 Modified: tests-common.sh Log: tests: let overlays add their own eclasses and testsuites and reuse this infrastructure
Revision Changes Path 1.13 eclass/tests/tests-common.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests-common.sh?rev=1.13&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests-common.sh?rev=1.13&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/tests-common.sh?r1=1.12&r2=1.13 Index: tests-common.sh =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/tests/tests-common.sh,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- tests-common.sh 25 Sep 2013 11:20:12 -0000 1.12 +++ tests-common.sh 16 Oct 2014 17:36:43 -0000 1.13 @@ -5,11 +5,21 @@ 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() { :; }
