commit:     537312b16550a72b3881d79377a670bc3b29e7e8
Author:     Antti Jarvinen <antti.jarvinen <AT> katiska <DOT> org>
AuthorDate: Sat Dec 26 01:47:16 2015 +0000
Commit:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Sat Dec 26 01:47:16 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=537312b1

net-p2p/classified-ads: Bug 568874 - use correct qmake version

Due to comments at https://github.com/gentoo/gentoo/pull/500
simplified src_test somewhat. Tried out with sandbox and
without, with failing test case and all-passing case:
seems to work.

Package-Manager: portage-2.2.20.1

 .../classified-ads-0.09_p20151220.ebuild           | 23 ++++++++--------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/net-p2p/classified-ads/classified-ads-0.09_p20151220.ebuild 
b/net-p2p/classified-ads/classified-ads-0.09_p20151220.ebuild
index 8f5b26d..df2195a 100644
--- a/net-p2p/classified-ads/classified-ads-0.09_p20151220.ebuild
+++ b/net-p2p/classified-ads/classified-ads-0.09_p20151220.ebuild
@@ -58,25 +58,18 @@ src_test() {
        cd test || die "test suite missing"
        "$(qt4_get_bindir)"/qmake || die "test suite configure failed"
        emake
-
-       if [ -e $HOME/.classified_ads/sqlite_db ]; then
-               mv $HOME/.classified_ads/sqlite_db 
$HOME/.classified_ads/sqlite_db.backup \
-                       || die "datafile backup failed"
-       fi
+       # test suite will create files under $HOME, set $HOME to point to
+       # safe location, ideas stolen from
+       # eclass/distutils-r1.eclass func distutils_install_for_testing
+       BACKUP_HOME=$HOME
+       export HOME=${BUILD_DIR}/tmp
+       mkdir -p $HOME || true
        ./testca
        result=$?
-       rm -f $HOME/.classified_ads/sqlite_db
-
-       if [ -e $HOME/.classified_ads/sqlite_db.backup ]; then
-               mv $HOME/.classified_ads/sqlite_db.backup 
$HOME/.classified_ads/sqlite_db \
-                       || die "datafile restore failed"
-       fi
-
+       export HOME=$BACKUP_HOME
        if [ $result != "0" ]; then
-               die "test failed with code $result"
+               die "test suite failed with error code " `echo $result`
        fi
-
-       return $result
 }
 
 src_install() {

Reply via email to