Skip to content

Commit

Permalink
t/helper/zlib-compile-flags: read zlib flags
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Philip Oakley authored and dscho committed Jun 4, 2019
1 parent f05d8a6 commit fc00458
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ TEST_BUILTINS_OBJS += test-xml-encode.o
TEST_BUILTINS_OBJS += test-wildmatch.o
TEST_BUILTINS_OBJS += test-windows-named-pipe.o
TEST_BUILTINS_OBJS += test-write-cache.o
TEST_BUILTINS_OBJS += test-zlib-compile-flags.o

# Do not add more tests here unless they have extra dependencies. Add
# them in TEST_BUILTINS_OBJS above.
Expand Down
1 change: 1 addition & 0 deletions t/helper/test-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static struct test_cmd cmds[] = {
{ "windows-named-pipe", cmd__windows_named_pipe },
#endif
{ "write-cache", cmd__write_cache },
{ "zlib-compile-flags", cmd__zlib_compile_flags },
};

static NORETURN void die_usage(void)
Expand Down
1 change: 1 addition & 0 deletions t/helper/test-tool.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ int cmd__wildmatch(int argc, const char **argv);
int cmd__windows_named_pipe(int argc, const char **argv);
#endif
int cmd__write_cache(int argc, const char **argv);
int cmd__zlib_compile_flags(int argc, const char **argv);

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

Expand Down
9 changes: 9 additions & 0 deletions t/helper/test-zlib-compile-flags.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "test-tool.h"
#include "git-compat-util.h"
#include <zlib.h>

int cmd__zlib_compile_flags(int argc, const char **argv)
{
printf("%lu\n", zlibCompileFlags());
return 0;
}
1 change: 1 addition & 0 deletions t/t-large-files-on-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test_description='test large file handling on windows'

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

0 comments on commit fc00458

Please sign in to comment.