Skip to content

Commit

Permalink
media-sound/amarok: enable tests, yay!
Browse files Browse the repository at this point in the history
  • Loading branch information
strohel committed Jan 4, 2012
1 parent 2791540 commit 4bc70da
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 24 deletions.
42 changes: 30 additions & 12 deletions media-sound/amarok/amarok-2.5.0-r1.ebuild
Expand Up @@ -24,11 +24,7 @@ fi


LICENSE="GPL-2" LICENSE="GPL-2"
SLOT="4" SLOT="4"
IUSE="cdda daap debug +embedded ipod lastfm mp3tunes mtp ofa opengl semantic-desktop +utils" IUSE="cdda daap debug +embedded ipod lastfm mp3tunes mtp ofa opengl semantic-desktop test +utils"

# Tests require gmock - http://code.google.com/p/gmock/
# It's not in the tree yet
RESTRICT="test"


# ipod requires gdk enabled and also gtk compiled in libgpod # ipod requires gdk enabled and also gtk compiled in libgpod
COMMONDEPEND=" COMMONDEPEND="
Expand Down Expand Up @@ -64,20 +60,27 @@ COMMONDEPEND="
DEPEND="${COMMONDEPEND} DEPEND="${COMMONDEPEND}
dev-util/automoc dev-util/automoc
dev-util/pkgconfig dev-util/pkgconfig
test? ( >=dev-cpp/gmock-1.4.0 )
" "
RDEPEND="${COMMONDEPEND} RDEPEND="${COMMONDEPEND}
$(add_kdebase_dep phonon-kde) $(add_kdebase_dep phonon-kde)
!media-sound/amarok-utils !media-sound/amarok-utils
" "


# tests don't currently build when MySQL embedded collection is disabled
REQUIRED_USE="test? ( embedded )"

src_prepare() { src_prepare() {
# en locale is special in a way that it is always enabled. English Amarok # only released versions have handbooks bundled
# handbook however lies in the doc/en_US folder and thus is not picked if [[ ${PV} != *9999* ]]; then
# up by kde4-functions eclass. Rename it. # en locale is special in a way that it is always enabled. English Amarok
sed -e 's:add_subdirectory(en_US):add_subdirectory(en):' \ # handbook however lies in the doc/en_US folder and thus is not picked
-i "${S}/doc/CMakeLists.txt" \ # up by kde4-functions eclass. Rename it.
|| die "Replacing en_US by en in doc/CMakeLists.txt failed." sed -e 's:add_subdirectory(en_US):add_subdirectory(en):' \
mv "${S}/doc/en_US" "${S}/doc/en" || die "Moving doc/en_US to doc/en failed." -i "${S}/doc/CMakeLists.txt" \
|| die "Replacing en_US by en in doc/CMakeLists.txt failed."
mv "${S}/doc/en_US" "${S}/doc/en" || die "Moving doc/en_US to doc/en failed."
fi


kde4-base_src_prepare kde4-base_src_prepare
} }
Expand All @@ -88,11 +91,13 @@ src_configure() {
local mycmakeargs local mycmakeargs


# Mygpo-qt not yet in portage, add IUSE when available # Mygpo-qt not yet in portage, add IUSE when available
# we already have test in IUSE, prevent 2nd compilation in src test
mycmakeargs=( mycmakeargs=(
-DWITH_PLAYER=ON -DWITH_PLAYER=ON
-DWITH_Libgcrypt=OFF -DWITH_Libgcrypt=OFF
-DWITH_Mygpo-qt=OFF -DWITH_Mygpo-qt=OFF
$(cmake-utils_use embedded WITH_MYSQL_EMBEDDED) $(cmake-utils_use embedded WITH_MYSQL_EMBEDDED)
$(cmake-utils_use test KDE4_BUILD_TESTS)
$(cmake-utils_use_with ipod) $(cmake-utils_use_with ipod)
$(cmake-utils_use_with ipod Gdk) $(cmake-utils_use_with ipod Gdk)
$(cmake-utils_use_with lastfm LibLastFm) $(cmake-utils_use_with lastfm LibLastFm)
Expand All @@ -110,6 +115,19 @@ src_configure() {
kde4-base_src_configure kde4-base_src_configure
} }


src_test() {
# prevent 2nd compilation, we have already built tests if USE=test

local excluded_tests="testmetafiletrack|testsqlscanmanager|testsqluserplaylistprovider"
einfo "Following tests are currently excluded:"
einfo " * termatafiletrack: fails"
einfo " * testsqlscanmanager: takes too long (60s and more)"
einfo " * testsqluserplaylistprovider: fails"

# sometimes tests timeout after 1500s; make the waiting shorter
cmake-utils_src_test --timeout 120 --exclude-regex "${excluded_tests}"
}

pkg_postinst() { pkg_postinst() {
kde4-base_pkg_postinst kde4-base_pkg_postinst


Expand Down
42 changes: 30 additions & 12 deletions media-sound/amarok/amarok-9999-r1.ebuild
Expand Up @@ -24,11 +24,7 @@ fi


LICENSE="GPL-2" LICENSE="GPL-2"
SLOT="4" SLOT="4"
IUSE="cdda daap debug +embedded ipod lastfm mp3tunes mtp ofa opengl semantic-desktop +utils" IUSE="cdda daap debug +embedded ipod lastfm mp3tunes mtp ofa opengl semantic-desktop test +utils"

# Tests require gmock - http://code.google.com/p/gmock/
# It's not in the tree yet
RESTRICT="test"


# ipod requires gdk enabled and also gtk compiled in libgpod # ipod requires gdk enabled and also gtk compiled in libgpod
COMMONDEPEND=" COMMONDEPEND="
Expand Down Expand Up @@ -64,20 +60,27 @@ COMMONDEPEND="
DEPEND="${COMMONDEPEND} DEPEND="${COMMONDEPEND}
dev-util/automoc dev-util/automoc
dev-util/pkgconfig dev-util/pkgconfig
test? ( >=dev-cpp/gmock-1.4.0 )
" "
RDEPEND="${COMMONDEPEND} RDEPEND="${COMMONDEPEND}
$(add_kdebase_dep phonon-kde) $(add_kdebase_dep phonon-kde)
!media-sound/amarok-utils !media-sound/amarok-utils
" "


# tests don't currently build when MySQL embedded collection is disabled
REQUIRED_USE="test? ( embedded )"

src_prepare() { src_prepare() {
# en locale is special in a way that it is always enabled. English Amarok # only released versions have handbooks bundled
# handbook however lies in the doc/en_US folder and thus is not picked if [[ ${PV} != *9999* ]]; then
# up by kde4-functions eclass. Rename it. # en locale is special in a way that it is always enabled. English Amarok
sed -e 's:add_subdirectory(en_US):add_subdirectory(en):' \ # handbook however lies in the doc/en_US folder and thus is not picked
-i "${S}/doc/CMakeLists.txt" \ # up by kde4-functions eclass. Rename it.
|| die "Replacing en_US by en in doc/CMakeLists.txt failed." sed -e 's:add_subdirectory(en_US):add_subdirectory(en):' \
mv "${S}/doc/en_US" "${S}/doc/en" || die "Moving doc/en_US to doc/en failed." -i "${S}/doc/CMakeLists.txt" \
|| die "Replacing en_US by en in doc/CMakeLists.txt failed."
mv "${S}/doc/en_US" "${S}/doc/en" || die "Moving doc/en_US to doc/en failed."
fi


kde4-base_src_prepare kde4-base_src_prepare
} }
Expand All @@ -88,11 +91,13 @@ src_configure() {
local mycmakeargs local mycmakeargs


# Mygpo-qt not yet in portage, add IUSE when available # Mygpo-qt not yet in portage, add IUSE when available
# we already have test in IUSE, prevent 2nd compilation in src test
mycmakeargs=( mycmakeargs=(
-DWITH_PLAYER=ON -DWITH_PLAYER=ON
-DWITH_Libgcrypt=OFF -DWITH_Libgcrypt=OFF
-DWITH_Mygpo-qt=OFF -DWITH_Mygpo-qt=OFF
$(cmake-utils_use embedded WITH_MYSQL_EMBEDDED) $(cmake-utils_use embedded WITH_MYSQL_EMBEDDED)
$(cmake-utils_use test KDE4_BUILD_TESTS)
$(cmake-utils_use_with ipod) $(cmake-utils_use_with ipod)
$(cmake-utils_use_with ipod Gdk) $(cmake-utils_use_with ipod Gdk)
$(cmake-utils_use_with lastfm LibLastFm) $(cmake-utils_use_with lastfm LibLastFm)
Expand All @@ -110,6 +115,19 @@ src_configure() {
kde4-base_src_configure kde4-base_src_configure
} }


src_test() {
# prevent 2nd compilation, we have already built tests if USE=test

local excluded_tests="testmetafiletrack|testsqlscanmanager|testsqluserplaylistprovider"
einfo "Following tests are currently excluded:"
einfo " * termatafiletrack: fails"
einfo " * testsqlscanmanager: takes too long (60s and more)"
einfo " * testsqluserplaylistprovider: fails"

# sometimes tests timeout after 1500s; make the waiting shorter
cmake-utils_src_test --timeout 120 --exclude-regex "${excluded_tests}"
}

pkg_postinst() { pkg_postinst() {
kde4-base_pkg_postinst kde4-base_pkg_postinst


Expand Down

0 comments on commit 4bc70da

Please sign in to comment.