Skip to content

Commit 9a9c400

Browse files
author
Philip Oakley
committed
t/helper/zlib-compile-flags: read zlib flags
zlib provides a convenience function that indicates the sizeOf the standard types. Windows builds should test if their zlib supports >4Gb address space for large file support. Also update the t-large-files-on-windows.sh test script to record the zlibFlags Signed-off-by: Philip Oakley <[email protected]>
1 parent 6883ff6 commit 9a9c400

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ TEST_BUILTINS_OBJS += test-xml-encode.o
759759
TEST_BUILTINS_OBJS += test-wildmatch.o
760760
TEST_BUILTINS_OBJS += test-windows-named-pipe.o
761761
TEST_BUILTINS_OBJS += test-write-cache.o
762+
TEST_BUILTINS_OBJS += test-zlib-compile-flags.o
762763

763764
# Do not add more tests here unless they have extra dependencies. Add
764765
# them in TEST_BUILTINS_OBJS above.

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static struct test_cmd cmds[] = {
6969
{ "windows-named-pipe", cmd__windows_named_pipe },
7070
#endif
7171
{ "write-cache", cmd__write_cache },
72+
{ "zlib-compile-flags", cmd__zlib_compile_flags },
7273
};
7374

7475
static NORETURN void die_usage(void)

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ int cmd__wildmatch(int argc, const char **argv);
5959
int cmd__windows_named_pipe(int argc, const char **argv);
6060
#endif
6161
int cmd__write_cache(int argc, const char **argv);
62+
int cmd__zlib_compile_flags(int argc, const char **argv);
6263

6364
int cmd_hash_impl(int ac, const char **av, int algo);
6465

t/helper/test-zlib-compile-flags.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "test-tool.h"
2+
#include "git-compat-util.h"
3+
#include <zlib.h>
4+
5+
int cmd__zlib_compile_flags(int argc, const char **argv)
6+
{
7+
printf("%lu\n", zlibCompileFlags());
8+
return 0;
9+
}

t/t-large-files-on-windows.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='test large file handling on windows'
55

66
test_expect_success SIZE_T_IS_64BIT 'require 64bit size_t' '
77
8+
test-tool zlib-compile-flags >zlibFlags.txt &&
89
dd if=/dev/zero of=file bs=1M count=4100 &&
910
git config core.compression 0 &&
1011
git config core.looseCompression 0 &&

0 commit comments

Comments
 (0)