Skip to content

Commit fc00458

Browse files
Philip Oakleydscho
authored andcommitted
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 f05d8a6 commit fc00458

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
@@ -758,6 +758,7 @@ TEST_BUILTINS_OBJS += test-xml-encode.o
758758
TEST_BUILTINS_OBJS += test-wildmatch.o
759759
TEST_BUILTINS_OBJS += test-windows-named-pipe.o
760760
TEST_BUILTINS_OBJS += test-write-cache.o
761+
TEST_BUILTINS_OBJS += test-zlib-compile-flags.o
761762

762763
# Do not add more tests here unless they have extra dependencies. Add
763764
# 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
@@ -70,6 +70,7 @@ static struct test_cmd cmds[] = {
7070
{ "windows-named-pipe", cmd__windows_named_pipe },
7171
#endif
7272
{ "write-cache", cmd__write_cache },
73+
{ "zlib-compile-flags", cmd__zlib_compile_flags },
7374
};
7475

7576
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
@@ -60,6 +60,7 @@ int cmd__wildmatch(int argc, const char **argv);
6060
int cmd__windows_named_pipe(int argc, const char **argv);
6161
#endif
6262
int cmd__write_cache(int argc, const char **argv);
63+
int cmd__zlib_compile_flags(int argc, const char **argv);
6364

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

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)