summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-06-16 20:42:24 +0100
committerJoonas Niilola <juippis@gentoo.org>2022-06-17 10:37:11 +0300
commitebfdcca1d782de04fa8c1290d2954339a10f71bb (patch)
treedde2a00a7f09ed72ec19f878180114b0a4011a5e /dev-libs/nspr
parentdev-libs/nss: build in parallel (diff)
downloadgentoo-ebfdcca1d782de04fa8c1290d2954339a10f71bb.tar.gz
gentoo-ebfdcca1d782de04fa8c1290d2954339a10f71bb.tar.bz2
gentoo-ebfdcca1d782de04fa8c1290d2954339a10f71bb.zip
dev-libs/nspr: wire up tests
Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/25930 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-libs/nspr')
-rw-r--r--dev-libs/nspr/nspr-4.34.ebuild31
1 files changed, 31 insertions, 0 deletions
diff --git a/dev-libs/nspr/nspr-4.34.ebuild b/dev-libs/nspr/nspr-4.34.ebuild
index 62e73fc0c568..d009166eea48 100644
--- a/dev-libs/nspr/nspr-4.34.ebuild
+++ b/dev-libs/nspr/nspr-4.34.ebuild
@@ -103,6 +103,37 @@ multilib_src_configure() {
econf "${myconf[@]}"
}
+multilib_src_test() {
+ # https://firefox-source-docs.mozilla.org/nspr/running_nspr_tests.html
+ cd "${BUILD_DIR}/pr/tests" || die
+ einfo "Building tests"
+ emake
+
+ einfo "Running test suite"
+ ../../../${P}/${PN}/pr/tests/runtests.pl | tee "${T}"/${ABI}-tests.log
+
+ # Needed to check if runtests.pl itself or the tee (somehow) failed
+ # (can't use die with pipes to check each component)
+ [[ ${PIPESTATUS[@]} == "0 0" ]] || die "Tests failed to run!"
+
+ local known_failures=(
+ # network-sandbox related?
+ cltsrv
+ # network-sandbox related?
+ gethost
+ )
+
+ local known_failure
+ for known_failure in "${known_failures[@]}" ; do
+ sed -i -e "/${known_failure}.*FAILED/d" "${T}"/${ABI}-tests.log || die
+ done
+
+ # But to actually check the test results, we examine the log.
+ if grep -q "FAILED" "${T}"/${ABI}-tests.log ; then
+ die "Test failure for ${ABI}!"
+ fi
+}
+
multilib_src_install() {
# Their build system is royally confusing, as usual
MINOR_VERSION=${MIN_PV} # Used for .so version