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
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')
-rw-r--r--net-irc/znc/Manifest2
-rw-r--r--net-irc/znc/files/znc-1.7.0-inttest-dir.patch55
-rw-r--r--net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch26
-rw-r--r--net-irc/znc/znc-1.7.0.ebuild38
-rw-r--r--net-irc/znc/znc-9999.ebuild37
5 files changed, 149 insertions, 9 deletions
diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 6949365add4b..c68a275dfe45 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,5 +1,5 @@
DIST googletest-release-1.7.0.tar.gz 468653 BLAKE2B 8dfca8b79dcd7b64ce84bad11ee68c549f4fe3dff7638ed1d845af4a7f754ad5df782d2cbebdb9fecfda2499dae6585e07cda7a8c8c454f0b70723d5c9578aa4 SHA512 c623d5720c4ed574e95158529872815ecff478c03bdcee8b79c9b042a603533f93fe55f939bcfe2cd745ce340fd626ad6d9a95981596f1a4d05053d874cd1dfc
-DIST gtest-1.8.0.tar.gz 1281617 BLAKE2B ac052b4d0eb0d8ded03a8c7dff05177818627b8a51f2dbc2c162b2ee2a5d1323539e7d0d02236d9ebb799995e018f0171c2fdaeb4de3bb339548265e50de79e6 SHA512 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d
+DIST gtest-ba96d0b1161f540656efdaed035b3c062b60e006.tar.gz 987370 BLAKE2B fcedfe559c4c93166962900117dc492da3cbb99165c30766c39131c20e3b41f057a31a8cb631beaca829c1e9966e90cbc37469ba56a5fc15a2bea86cbe401a63 SHA512 ce78098f973b45f4a177db387c42a56d5ea34407a2af278760b850c326e8450760a58991d62a5408f5df79f89fefd10fee71745b7e8669b2a6f74fa63a259600
DIST znc-1.6.5.tar.gz 1470681 BLAKE2B 9de0b211280489423bc2894d0e76d7276aa42428d07d64516372a9ca6d1616db1f27c0142b54160c61cbee89d65ceadf941d001319254dbff9eb5b016988482e SHA512 d78603ac86d1fb92cdf591b1eb6d32fa19b0e39414bd69e1300c537051612ae590c43d3b8e4dd598cdff605bf3aa1d3d5d806edd428d15d50f733e1670f3e626
DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7
DIST znc-1.7.0.tar.gz 1853666 BLAKE2B 3e519d4005a10a9a5329f22ab6abbd19dfa2c7cecb949c138bc72909eae8883576fc0352e3ac46b852b8c58f038150419720aa48791a1339b004206f3afc20e9 SHA512 718dec65dfa2374c568b2694e4faef1f8cf313ae96d171e2263656e077e0fae5f8037c69a23ae33f4ea314ac6e15480c7dccef73ad3ac9324eb79caca622d54b
diff --git a/net-irc/znc/files/znc-1.7.0-inttest-dir.patch b/net-irc/znc/files/znc-1.7.0-inttest-dir.patch
new file mode 100644
index 000000000000..250eccc53fb6
--- /dev/null
+++ b/net-irc/znc/files/znc-1.7.0-inttest-dir.patch
@@ -0,0 +1,55 @@
+diff --git a/include/znc/znc.h b/include/znc/znc.h
+index ecb2b41a..a791a648 100644
+--- a/include/znc/znc.h
++++ b/include/znc/znc.h
+@@ -251,6 +251,7 @@ class CZNC : private CCoreTranslationMixin {
+ void DisableConfigTimer();
+
+ static void DumpConfig(const CConfig* Config);
++ static CString UnusualRoot();
+
+ private:
+ static CString FormatBindError();
+diff --git a/src/Modules.cpp b/src/Modules.cpp
+index 5aec7805..6f9c34ae 100644
+--- a/src/Modules.cpp
++++ b/src/Modules.cpp
+@@ -1899,9 +1899,10 @@ CModules::ModDirList CModules::GetModDirs() {
+ sDir = CZNC::Get().GetModPath() + "/";
+ ret.push(std::make_pair(sDir, sDir));
+
++ CString sUnusualRoot = CZNC::UnusualRoot();
+ // <moduledir> and <datadir> (<prefix>/lib/znc)
+- ret.push(std::make_pair(_MODDIR_ + CString("/"),
+- _DATADIR_ + CString("/modules/")));
++ ret.push(std::make_pair(sUnusualRoot + _MODDIR_ + CString("/"),
++ sUnusualRoot + _DATADIR_ + CString("/modules/")));
+
+ return ret;
+ }
+diff --git a/src/WebModules.cpp b/src/WebModules.cpp
+index 19ece50a..8ea4d9fa 100644
+--- a/src/WebModules.cpp
++++ b/src/WebModules.cpp
+@@ -563,7 +563,7 @@ CString CWebSock::GetSkinPath(const CString& sSkinName) {
+ sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkinName;
+
+ if (!CFile::IsDir(sRet)) {
+- sRet = CString(_SKINDIR_) + "/" + sSkinName;
++ sRet = CZNC::UnusualRoot() + CString(_SKINDIR_) + "/" + sSkinName;
+ }
+ }
+
+diff --git a/src/znc.cpp b/src/znc.cpp
+index 4e7216ee..dd901497 100644
+--- a/src/znc.cpp
++++ b/src/znc.cpp
+@@ -2130,3 +2130,8 @@ void CZNC::DisableConfigTimer() {
+ m_pConfigTimer = nullptr;
+ }
+ }
++
++CString CZNC::UnusualRoot() {
++ char* szUnusualRoot = getenv("ZNC_UNUSUAL_ROOT");
++ return szUnusualRoot ? szUnusualRoot : "";
++}
diff --git a/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch b/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch
new file mode 100644
index 000000000000..0be20e4c08d0
--- /dev/null
+++ b/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch
@@ -0,0 +1,26 @@
+From abee9f9bfc8c9ca9d4616238fdd812c4200b17d5 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Thu, 28 Jun 2018 23:57:29 +0100
+Subject: [PATCH] Fix a warning in integration test / gmake / znc-buildmod
+ interaction.
+
+It was requested on https://github.com/gentoo/gentoo/pull/8901
+---
+ test/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index b19c22fab..296cb0de7 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -85,5 +85,10 @@ externalproject_add(inttest_bin
+ "-DZNC_BIN_DIR:path=${CMAKE_INSTALL_FULL_BINDIR}"
+ "-DQt5_HINTS:path=${brew_qt5}")
+ add_custom_target(inttest COMMAND
++ # Prevent a warning from test of znc-buildmod, when inner make
++ # discovers that there is an outer make and tries to use it:
++ # gmake[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
++ # This option doesn't affect ninja, which doesn't show that warning anyway.
++ ${CMAKE_COMMAND} -E env MAKEFLAGS=
+ "${CMAKE_CURRENT_BINARY_DIR}/integration/inttest")
+ add_dependencies(inttest inttest_bin)
diff --git a/net-irc/znc/znc-1.7.0.ebuild b/net-irc/znc/znc-1.7.0.ebuild
index b27016716af6..7cd8c8865979 100644
--- a/net-irc/znc/znc-1.7.0.ebuild
+++ b/net-irc/znc/znc-1.7.0.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,14 @@ 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-fix-make-warning.patch
+ "${FILESDIR}"/${PN}-1.7.0-inttest-dir.patch
+)
+
pkg_setup() {
if use python; then
python-single-r1_pkg_setup
@@ -71,6 +77,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 +99,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 +108,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() {
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() {