diff options
author | David Robillard <d@drobilla.net> | 2019-10-18 13:57:32 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-10-18 17:10:35 +0200 |
commit | 813d202a306f1e7f582ad00da78f5ff5a94a4680 (patch) | |
tree | 5127d359132f38c31846181f5513811827e6c0fc | |
parent | ea4e3d3909be2f0e393362d496a9662591a4e356 (diff) | |
download | zix-813d202a306f1e7f582ad00da78f5ff5a94a4680.tar.gz zix-813d202a306f1e7f582ad00da78f5ff5a94a4680.tar.bz2 zix-813d202a306f1e7f582ad00da78f5ff5a94a4680.zip |
Fix MinGW build
-rw-r--r-- | test/btree_test.c | 2 | ||||
-rw-r--r-- | test/hash_test.c | 2 | ||||
-rw-r--r-- | wscript | 9 |
3 files changed, 12 insertions, 1 deletions
diff --git a/test/btree_test.c b/test/btree_test.c index 3b41984..5ffcd87 100644 --- a/test/btree_test.c +++ b/test/btree_test.c @@ -460,6 +460,7 @@ main(int argc, char** argv) } printf("\n"); +#ifndef _WIN32 const size_t total_n_allocs = test_malloc_get_n_allocs(); const size_t fail_n_elems = 1000; printf("Testing 0 ... %zu failed allocations\n", total_n_allocs); @@ -473,6 +474,7 @@ main(int argc, char** argv) } test_malloc_reset((size_t)-1); +#endif return EXIT_SUCCESS; } diff --git a/test/hash_test.c b/test/hash_test.c index c2ecb2d..f4ebdfe 100644 --- a/test/hash_test.c +++ b/test/hash_test.c @@ -205,6 +205,7 @@ main(void) return 1; } +#ifndef _WIN32 const size_t total_n_allocs = test_malloc_get_n_allocs(); printf("Testing 0 ... %zu failed allocations\n", total_n_allocs); expect_failure = true; @@ -214,6 +215,7 @@ main(void) } test_malloc_reset((size_t)-1); +#endif return 0; } @@ -140,6 +140,8 @@ def build(bld): test_libs = ['pthread', 'dl'] if bld.env.MSVC_COMPILER: test_libs = [] + elif bld.env.DEST_OS == 'win32': + test_libs = 'pthread' if bld.is_defined('HAVE_GCOV'): test_cflags += ['--coverage'] test_linkflags += ['--coverage'] @@ -156,10 +158,15 @@ def build(bld): cflags = test_cflags + ['-DZIX_INTERNAL'], linkflags = test_linkflags) + if bld.env.DEST_OS == 'win32': + test_malloc = [] + else: + test_malloc = ['test/test_malloc.c'] + # Unit test programs for i in tests: bld(features = 'c cprogram', - source = ['test/%s.c' % i, 'test/test_malloc.c'], + source = ['test/%s.c' % i] + test_malloc, includes = ['.'], use = 'libzix_profiled', lib = test_libs, |