summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Sokolov <sokolov@google.com>2018-06-19 02:13:38 +0100
committerLouis Sautier <sbraz@gentoo.org>2018-07-04 23:33:36 +0200
commit15112014e7605d13624297d7601504b5d187a6de (patch)
treec7b82be7b5486613e03b0a4257a05bfe2a2f105b /net-irc/znc/znc-9999.ebuild
parentRevert "dev-lang/squirrel: declare used CMake variables, bug #659880" (diff)
downloadgentoo-15112014e7605d13624297d7601504b5d187a6de.tar.gz
gentoo-15112014e7605d13624297d7601504b5d187a6de.tar.bz2
gentoo-15112014e7605d13624297d7601504b5d187a6de.zip
net-irc/znc: enable integration testing
Closes: https://github.com/gentoo/gentoo/pull/8901
Diffstat (limited to 'net-irc/znc/znc-9999.ebuild')
-rw-r--r--net-irc/znc/znc-9999.ebuild37
1 files changed, 33 insertions, 4 deletions
diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild
index b27016716af6..ec9c6196f378 100644
--- a/net-irc/znc/znc-9999.ebuild
+++ b/net-irc/znc/znc-9999.ebuild
@@ -7,8 +7,8 @@ PYTHON_COMPAT=( python3_{4,5,6} )
inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user
-GTEST_VER="1.8.0"
-GTEST_URL="https://github.com/google/googletest/archive/release-${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+GTEST_VER="ba96d0b1161f540656efdaed035b3c062b60e006" # 1.8.0 is too old, but newer version not released yet
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
DESCRIPTION="An advanced IRC Bouncer"
if [[ ${PV} == *9999* ]]; then
@@ -49,8 +49,13 @@ DEPEND="
nls? ( sys-devel/gettext )
perl? ( >=dev-lang/swig-3.0.0 )
python? ( >=dev-lang/swig-3.0.0 )
+ test? ( dev-qt/qtnetwork:5 )
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7.0-inttest-dir.patch
+)
+
pkg_setup() {
if use python; then
python-single-r1_pkg_setup
@@ -71,6 +76,9 @@ src_prepare() {
rm modules/modpython/generated.tar.gz || die
fi
+ sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
+ test/CMakeLists.txt || die
+
cmake-utils_src_prepare
}
@@ -90,8 +98,8 @@ src_configure() {
)
if [[ ${PV} != *9999* ]] && use test; then
- export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
- export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+ export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest"
+ export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock"
fi
cmake-utils_src_configure
@@ -99,6 +107,27 @@ src_configure() {
src_test() {
cmake-utils_src_make unittest
+ if has network-sandbox ${FEATURES}; then
+ cmake-utils_src_make install DESTDIR="${T}/inttest"
+ local filter='-'
+ if ! use perl; then
+ filter="${filter}:ZNCTest.Modperl*"
+ fi
+ if ! use python; then
+ filter="${filter}:ZNCTest.Modpython*"
+ fi
+ # CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
+ # invocations from inside the test
+ GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
+ CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
+ CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
+ cmake-utils_src_make inttest
+ else
+ # TODO: don't require sandbox after
+ # https://github.com/znc/znc/pull/1363 is implemented
+ ewarn "FEATURES=-network-sandbox; skipping integration tests which"
+ ewarn "temporary open local ports."
+ fi
}
src_install() {