From d7a3e2ae5fdd875eb274f845f16daf8935d59db8 Mon Sep 17 00:00:00 2001 From: John McNamara Date: Sun, 26 Jun 2016 03:28:09 +0100 Subject: [PATCH] Added 32bit build to test matrix. --- .travis.yml | 23 ++++++++++++----------- Makefile | 4 +++- src/Makefile | 14 +++++++++----- src/utility.c | 2 +- third_party/minizip/Makefile | 2 +- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8630ad97..336bad9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,20 +4,21 @@ compiler: - clang - gcc +env: + - CFLAGS='-Werror' + - CFLAGS='-Werror -m32' + install: - sudo pip install pytest - sudo apt-get update + - sudo apt-get install -y gcc-multilib + - sudo apt-get install -y zlib1g-dev + - sudo apt-get install -y zlib1g-dev:i386 + - sudo apt-get install -y gcc - sudo apt-get install -y valgrind - - curl -O -L http://zlib.net/zlib-1.2.8.tar.gz - - tar zxf zlib-1.2.8.tar.gz - - cd zlib-1.2.8 - - ./configure - - make - - sudo make install - - cd .. script: - - CFLAGS=-Werror make - - make test_functional - - make test_unit - - make test_valgrind + - make V=1 + - make test_functional V=1 + - make test_unit V=1 + - make test_valgrind V=1 diff --git a/Makefile b/Makefile index 206ad168..5c1b1942 100644 --- a/Makefile +++ b/Makefile @@ -49,10 +49,12 @@ test_unit : $(Q)$(MAKE) -C src test_lib $(Q)$(MAKE) -C test/unit test -# Test the functional test exes with valgrind. +# Test the functional test exes with valgrind (in 64bit mode only). test_valgrind : all +ifeq ($(findstring m32,$(CFLAGS)),) $(Q)$(MAKE) -C test/functional/src test_valgrind $(Q)$(MAKE) -C examples test_valgrind +endif # Minimal target for quick compile without creating the libs. test_compile : diff --git a/src/Makefile b/src/Makefile index bf7919f7..b6142c4d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -81,22 +81,26 @@ test_lib : libxlsxwriter_test.a # The static library. $(LIBXLSXWRITER_A) : $(OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $^ + $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $^ # The dynamic library. +ifeq ($(findstring m32,$(CFLAGS)),m32) +ARCH = -m32 +endif + $(LIBXLSXWRITER_SO) : $(SOBJS) - $(Q)$(CC) $(SOFLAGS) -o $@ $(MINIZIP_DIR)/ioapi.so $(MINIZIP_DIR)/zip.so $^ -lz + $(Q)$(CC) $(SOFLAGS) $(ARCH) -o $@ $(MINIZIP_DIR)/ioapi.so $(MINIZIP_DIR)/zip.so $^ -lz # The test library. $(LIBXLSXWRITER_TO) : $(TOBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $^ + $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $^ # Minimal target for quick compile without creating the libs. test_compile : $(OBJS) # Targets for the object files. %.o : %.c $(HDRS) - $(Q)$(CC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< + $(Q)$(CC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< %.so : %.c $(HDRS) $(Q)$(CC) $(FPIC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@ @@ -107,4 +111,4 @@ test_compile : $(OBJS) # Clean up any temp/build files. clean : - $(Q)rm -f *.o *.a *.so *.to *.dylib + $(Q)rm -f *.o *.a *.so *.to *.dylib *.dll diff --git a/src/utility.c b/src/utility.c index 094c65b1..c50a6a6b 100644 --- a/src/utility.c +++ b/src/utility.c @@ -484,7 +484,7 @@ lxw_tmpfile(void) #else /* This variant allows you to define the tmpfile directory and format. * Not ANSI C compatible so compile as follows: - * CFLAGS="-D USE_TMPFILE2 -U __STRICT_ANSI__" make + * CFLAGS="-DUSE_TMPFILE2 -U__STRICT_ANSI__" make */ #include FILE * diff --git a/third_party/minizip/Makefile b/third_party/minizip/Makefile index 911f32cf..b969ebcf 100644 --- a/third_party/minizip/Makefile +++ b/third_party/minizip/Makefile @@ -23,7 +23,7 @@ MING_LIKE = y endif FPIC = -fPIC -CFLAGS = -O3 -DNOCRYPT -DNOUNCRYPT +CFLAGS += -O3 -DNOCRYPT -DNOUNCRYPT # Change make options on MinGW/MinGW64/Cygwin. ifdef MING_LIKE