From 371f97457d07376cc27a939433b92a89bc243f1c Mon Sep 17 00:00:00 2001 From: James Browning Date: Tue, 12 Apr 2022 04:52:09 -0700 Subject: [PATCH] net-misc/ntpsec: Try to only run tests in src_test Since ./waf test runs all the test, this eliminates the need for the tests useflag which filled that space. Thus it's eliminated. Signed-off-by: James T Browning tested: some --- .../files/ntpsec-1.2.1-build-notests.patch | 48 +++++++++++++++++++ net-misc/ntpsec/files/ntpsec-py3-test-clarify | 34 +++++++++++++ net-misc/ntpsec/metadata.xml | 1 - net-misc/ntpsec/ntpsec-1.2.1-r2.ebuild | 16 +++++-- net-misc/ntpsec/ntpsec-9999.ebuild | 15 ++++-- 5 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 net-misc/ntpsec/files/ntpsec-1.2.1-build-notests.patch create mode 100644 net-misc/ntpsec/files/ntpsec-py3-test-clarify diff --git a/net-misc/ntpsec/files/ntpsec-1.2.1-build-notests.patch b/net-misc/ntpsec/files/ntpsec-1.2.1-build-notests.patch new file mode 100644 index 000000000..dab51a97f --- /dev/null +++ b/net-misc/ntpsec/files/ntpsec-1.2.1-build-notests.patch @@ -0,0 +1,48 @@ +From 1a7bb2e3a2749bd709ea4cf10b66b6f6d05aaf9d Mon Sep 17 00:00:00 2001 +From: James Browning +Date: Sun, 10 Apr 2022 07:53:37 -0700 +Subject: [PATCH] I: NTPsec build does not repect --notests + +STR: (run the following) +- git clone https://gitlab.com/NTPsec/ntpsec +- cd ntpsec +- ./waf configure build --notests -p + +AR: NTPsec runs tests despite having a parameter telling it not to +ER: NTPsec should not run tests when it has been told not to +--- + wscript | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/wscript b/wscript +index c1d765046..d8a20b82e 100644 +--- a/wscript ++++ b/wscript +@@ -1131,6 +1131,7 @@ def build(ctx): + ctx.manpage(8, "ntpclients/ntpsnmpd-man.adoc") + + # Skip running unit tests on a cross compile build ++ from waflib import Options + if not ctx.env.ENABLE_CROSS: + # Force re-running of tests. Same as 'waf --alltests' + if ctx.cmd == "check": +@@ -1139,6 +1140,8 @@ def build(ctx): + # Print log if -v is supplied + if verbose > 0: + ctx.add_post_fun(test_print_log) ++ elif Options.options.no_tests: ++ return + + # Test binaries + ctx.add_post_fun(bin_test) +@@ -1152,7 +1155,6 @@ def build(ctx): + ctx.add_post_fun(bin_test_summary) + else: + pprint("YELLOW", "Unit test runner skipped on a cross-compiled build.") +- from waflib import Options + Options.options.no_tests = True + + if ctx.cmd == "build": +-- +2.32.0 + diff --git a/net-misc/ntpsec/files/ntpsec-py3-test-clarify b/net-misc/ntpsec/files/ntpsec-py3-test-clarify new file mode 100644 index 000000000..027c3df18 --- /dev/null +++ b/net-misc/ntpsec/files/ntpsec-py3-test-clarify @@ -0,0 +1,34 @@ +From f360741dec76a9c9d831f0b547596891ea321599 Mon Sep 17 00:00:00 2001 +From: James Browning +Date: Sun, 10 Apr 2022 16:23:34 -0700 +Subject: [PATCH] clean test output up in Python 3 + +--- + wafhelpers/test.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/wafhelpers/test.py b/wafhelpers/test.py +index 9351a5675..6bba34881 100644 +--- a/wafhelpers/test.py ++++ b/wafhelpers/test.py +@@ -31,12 +31,13 @@ def test_print_log(ctx): + pprint("YELLOW", "RETURN VALUE:", retval) + print("") + +- if retval or error: ++ if retval: + pprint("RED", "****** ERROR ******\n") + +- print(error or lines) ++ print(polystr(error) or polystr(lines)) + +- if (not retval) and (not error): +- pprint("GREEN", "****** LOG ******\n", lines) ++ else: ++ pprint("GREEN", "****** LOG ******\n", ++ polystr(lines), polystr(error)) + + print("") +-- +2.32.0 + diff --git a/net-misc/ntpsec/metadata.xml b/net-misc/ntpsec/metadata.xml index 69f78f92c..e19df036b 100644 --- a/net-misc/ntpsec/metadata.xml +++ b/net-misc/ntpsec/metadata.xml @@ -31,6 +31,5 @@ NTPsec project - a secure, hardened, and improved implementation of Network Time NIST/USNO/PTB Modem Time Services Support for undisciplined local clock (not recommended) Specify the interval over which a leap second is applied (experimental) - Enable tests diff --git a/net-misc/ntpsec/ntpsec-1.2.1-r2.ebuild b/net-misc/ntpsec/ntpsec-1.2.1-r2.ebuild index 80e17ecb6..06aac33ca 100644 --- a/net-misc/ntpsec/ntpsec-1.2.1-r2.ebuild +++ b/net-misc/ntpsec/ntpsec-1.2.1-r2.ebuild @@ -30,7 +30,7 @@ IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_} LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0" SLOT="0" -IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear tests" #ionice +IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear" #ionice REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" # net-misc/pps-tools oncore,pps @@ -61,6 +61,8 @@ PATCHES=( "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch" "${FILESDIR}/${PN}-1.2.1-seccomp-rollup.patch" "${FILESDIR}/${PN}-1.2.1-seccomp-rseq-glibc-2.35.patch" + "${FILESDIR}/${PN}-1.2.1-build-notests.patch" + "${FILESDIR}/${PN}-py3-test-clarify.patch" ) WAF_BINARY="${S}/waf" @@ -94,6 +96,7 @@ src_configure() { CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`" local myconf=( + --notests --nopyc --nopyo --enable-pylib ext @@ -105,7 +108,6 @@ src_configure() { $(use samba && echo "--enable-mssntp") $(use seccomp && echo "--enable-seccomp") $(use smear && echo "--enable-leap-smear") - $(use tests && echo "--alltests") $(use debug && echo "--enable-debug") ) @@ -118,7 +120,15 @@ src_configure() { src_compile() { unset MAKEOPTS python_compile() { - waf-utils_src_compile + waf-utils_src_compile --notests + } + python_foreach_impl run_in_build_dir python_compile +} + +src_test() { + debug-print-function ${FUNCNAME} "$@" + python_compile() { + waf-utils_src_compile check } python_foreach_impl run_in_build_dir python_compile } diff --git a/net-misc/ntpsec/ntpsec-9999.ebuild b/net-misc/ntpsec/ntpsec-9999.ebuild index 2065ee52d..64d2be872 100644 --- a/net-misc/ntpsec/ntpsec-9999.ebuild +++ b/net-misc/ntpsec/ntpsec-9999.ebuild @@ -30,7 +30,7 @@ IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_} LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0" SLOT="0" -IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear tests" #ionice +IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear" #ionice REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" # net-misc/pps-tools oncore,pps @@ -59,6 +59,7 @@ DEPEND="${CDEPEND} PATCHES=( "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch" + "${FILESDIR}/${PN}-py3-test-clarify.patch" ) WAF_BINARY="${S}/waf" @@ -92,6 +93,7 @@ src_configure() { CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`" local myconf=( + --notests --nopyc --nopyo --enable-pylib ext @@ -103,7 +105,6 @@ src_configure() { $(use samba && echo "--enable-mssntp") $(use seccomp && echo "--enable-seccomp") $(use smear && echo "--enable-leap-smear") - $(use tests && echo "--alltests") $(use debug && echo "--enable-debug") ) @@ -116,7 +117,15 @@ src_configure() { src_compile() { unset MAKEOPTS python_compile() { - waf-utils_src_compile + waf-utils_src_compile --notests + } + python_foreach_impl run_in_build_dir python_compile +} + +src_test() { + debug-print-function ${FUNCNAME} "$@" + python_compile() { + waf-utils_src_compile check } python_foreach_impl run_in_build_dir python_compile } -- 2.32.0