commit:     46965e05331d365c042343c20afc9d325d924fea
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Wed May 29 14:38:44 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed May 29 14:39:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46965e05

net-vpn/gsocket: enable tests

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-vpn/gsocket/gsocket-1.4.43.ebuild | 26 ++++++++++++++++++++++++--
 net-vpn/gsocket/gsocket-9999.ebuild   | 26 ++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/net-vpn/gsocket/gsocket-1.4.43.ebuild 
b/net-vpn/gsocket/gsocket-1.4.43.ebuild
index f6f2c998560e..39e124344a92 100644
--- a/net-vpn/gsocket/gsocket-1.4.43.ebuild
+++ b/net-vpn/gsocket/gsocket-1.4.43.ebuild
@@ -19,8 +19,18 @@ fi
 LICENSE="BSD-2"
 SLOT="0"
 
-DEPEND="dev-libs/openssl:="
-RDEPEND="${DEPEND}"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="dev-libs/openssl:="
+DEPEND="
+       ${COMMON_DEPEND}
+       test? (
+               net-analyzer/netcat
+               net-misc/socat
+       )
+"
+RDEPEND="${COMMON_DEPEND}"
 
 PATCHES=(
        # https://github.com/hackerschoice/gsocket/pull/104
@@ -38,6 +48,18 @@ src_prepare() {
        eautoreconf
 }
 
+src_configure() {
+       econf $(use_enable test tests)
+}
+
+src_test() {
+       cd tests || die
+
+       ./run_ft_tests.sh || die
+       # Most of the "gs_tests" seem to fail (probably due the sandbox).
+       ./run_gs_tests.sh 4.1 || die
+}
+
 src_install() {
        default
 

diff --git a/net-vpn/gsocket/gsocket-9999.ebuild 
b/net-vpn/gsocket/gsocket-9999.ebuild
index f6f2c998560e..39e124344a92 100644
--- a/net-vpn/gsocket/gsocket-9999.ebuild
+++ b/net-vpn/gsocket/gsocket-9999.ebuild
@@ -19,8 +19,18 @@ fi
 LICENSE="BSD-2"
 SLOT="0"
 
-DEPEND="dev-libs/openssl:="
-RDEPEND="${DEPEND}"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="dev-libs/openssl:="
+DEPEND="
+       ${COMMON_DEPEND}
+       test? (
+               net-analyzer/netcat
+               net-misc/socat
+       )
+"
+RDEPEND="${COMMON_DEPEND}"
 
 PATCHES=(
        # https://github.com/hackerschoice/gsocket/pull/104
@@ -38,6 +48,18 @@ src_prepare() {
        eautoreconf
 }
 
+src_configure() {
+       econf $(use_enable test tests)
+}
+
+src_test() {
+       cd tests || die
+
+       ./run_ft_tests.sh || die
+       # Most of the "gs_tests" seem to fail (probably due the sandbox).
+       ./run_gs_tests.sh 4.1 || die
+}
+
 src_install() {
        default
 

Reply via email to