diff mbox series

[RFC,5/7] test-lib: use pkgsrc provided unzip for NetBSD

Message ID 5fe64afa3d7cf9a46a527c47885e8e60dae2445c.1543143503.git.carenas@gmail.com (mailing list archive)
State New, archived
Headers show
Series test: NetBSD support | expand

Commit Message

Carlo Marcelo Arenas Belón Nov. 25, 2018, 11:06 a.m. UTC
d98b2c5fce ("test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/",
2016-07-21) added an exception to the test suite for FreeBSD because the
tests assume functionality not provided by its base unzip tool.

NetBSD shares that limitation and provides a package that could be used
instead so all tests from t5003 succeed

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 t/test-lib.sh | 1 +
 1 file changed, 1 insertion(+)

Comments

Junio C Hamano Nov. 26, 2018, 6:50 a.m. UTC | #1
Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:

> d98b2c5fce ("test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/",
> 2016-07-21) added an exception to the test suite for FreeBSD because the
> tests assume functionality not provided by its base unzip tool.
>
> NetBSD shares that limitation and provides a package that could be used
> instead so all tests from t5003 succeed
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  t/test-lib.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 6c6c0af7a1..2acb35f277 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -1244,6 +1244,7 @@ test_lazy_prereq SANITY '
>  '
>  
>  test FreeBSD != $uname_s || GIT_UNZIP=${GIT_UNZIP:-/usr/local/bin/unzip}
> +test $uname_s = NetBSD && GIT_UNZIP=${GIT_UNZIP:-/usr/pkg/bin/unzip}

This is OK for now, but I wonder why this is done in test-lib.sh in
the first place, unlike $(TAR) that is set and configurable from the
top level.  The difference is that GIT_UNZIP happens to be used only
in tests, while TAR is used in the primary build procedure.

But I suspect that in the longer run, we should allow UNZIP to be
given next to TAR to the top-level Makefile and export it down.
That would allow the usual mechanism like config.mak.uname,
./configure and "make TAR=... UNZIP=..." command line override
to be used uniformly, without people having to worry about the
distinction.  The builders should *not* have to care that one is
used in the build and the other is only used in the test.

>  GIT_UNZIP=${GIT_UNZIP:-unzip}
>  test_lazy_prereq UNZIP '
>  	"$GIT_UNZIP" -v
diff mbox series

Patch

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 6c6c0af7a1..2acb35f277 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1244,6 +1244,7 @@  test_lazy_prereq SANITY '
 '
 
 test FreeBSD != $uname_s || GIT_UNZIP=${GIT_UNZIP:-/usr/local/bin/unzip}
+test $uname_s = NetBSD && GIT_UNZIP=${GIT_UNZIP:-/usr/pkg/bin/unzip}
 GIT_UNZIP=${GIT_UNZIP:-unzip}
 test_lazy_prereq UNZIP '
 	"$GIT_UNZIP" -v