diff mbox series

[v3,3/8] test-lib: add prerequisite for 64-bit platforms

Message ID 489500bb1dcaffecab42672658990cfc26d52d7c.1635515959.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Allow clean/smudge filters to handle huge files in the LLP64 data model | expand

Commit Message

Carlo Marcelo Arenas Belón Oct. 29, 2021, 1:59 p.m. UTC
From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>

Allow tests that assume a 64-bit `size_t` to be skipped in 32-bit
platforms and regardless of the size of `long`.

This imitates the `LONG_IS_64BIT` prerequisite.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/test-lib.sh | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Junio C Hamano Oct. 29, 2021, 10:52 p.m. UTC | #1
"Carlo Marcelo Arenas Belón via GitGitGadget"
<gitgitgadget@gmail.com> writes:

> +test_lazy_prereq SIZE_T_IS_64BIT '
> +	test 8 -eq "$(build_option sizeof-size_t)"
> +'
> +
>  test_lazy_prereq LONG_IS_64BIT '
>  	test 8 -le "$(build_option sizeof-long)"
>  '

In the longer run, LONG_IS_64BIT wants to be renamed to indicate
that it is at least 64-bit long.  LONG_HAS_64BIT, perhaps?

Obviously it can be left outside the scope of this series.
Johannes Schindelin Nov. 2, 2021, 2:35 p.m. UTC | #2
Hi Junio,

On Fri, 29 Oct 2021, Junio C Hamano wrote:

> "Carlo Marcelo Arenas Belón via GitGitGadget"
> <gitgitgadget@gmail.com> writes:
>
> > +test_lazy_prereq SIZE_T_IS_64BIT '
> > +	test 8 -eq "$(build_option sizeof-size_t)"
> > +'
> > +
> >  test_lazy_prereq LONG_IS_64BIT '
> >  	test 8 -le "$(build_option sizeof-long)"
> >  '
>
> In the longer run, LONG_IS_64BIT wants to be renamed to indicate
> that it is at least 64-bit long.  LONG_HAS_64BIT, perhaps?

Or `LONG_AT_LEAST_64BIT`. It does look as if the current users are asking
for that, not for precisely 64-bit.

> Obviously it can be left outside the scope of this series.

Definitely. The patch series already grew from 5 to 8 patches. We really
need to be more conscious of scope here.

Ciao,
Dscho
diff mbox series

Patch

diff --git a/t/test-lib.sh b/t/test-lib.sh
index adaf03543e8..af1a94c2c20 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1642,6 +1642,10 @@  build_option () {
 	sed -ne "s/^$1: //p"
 }
 
+test_lazy_prereq SIZE_T_IS_64BIT '
+	test 8 -eq "$(build_option sizeof-size_t)"
+'
+
 test_lazy_prereq LONG_IS_64BIT '
 	test 8 -le "$(build_option sizeof-long)"
 '