net-p2p/classified-ads: Bug 568874 - use correct qmake version
authorAntti Jarvinen <antti.jarvinen@katiska.org>
Sat, 26 Dec 2015 01:47:16 +0000 (03:47 +0200)
committerAntti Jarvinen <antti.jarvinen@katiska.org>
Sat, 26 Dec 2015 01:47:16 +0000 (03:47 +0200)
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

net-p2p/classified-ads/classified-ads-0.09_p20151220.ebuild

index 8f5b26d2453fb81bce909fd8df87e36155eaf40b..df2195ac8b06ef939d7a04ef4c61a7cdb6357dca 100644 (file)
@@ -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() {