Merge pull request #1910 from facebook/travisTest

mingw cross compilation test
This commit is contained in:
Yann Collet
2019-11-27 18:45:16 -08:00
committed by GitHub
4 changed files with 76 additions and 76 deletions
+54 -51
View File
@@ -1,7 +1,6 @@
# Medium Tests: Run on all commits/PRs to dev branch # Medium Tests: Run on all commits/PRs to dev branch
language: c language: c
dist: trusty
git: git:
depth: 1 depth: 1
@@ -26,39 +25,39 @@ env:
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- name: arm64 - name: arm64 # ~2.5 mn
os: linux os: linux
arch: arm64 arch: arm64
script: script:
- make check - make check
- name: make test (complete) - name: make test (complete) # ~14mn
script: script:
# DEVNULLRIGHTS : will request sudo rights to test permissions on /dev/null # DEVNULLRIGHTS : will request sudo rights to test permissions on /dev/null
- DEVNULLRIGHTS=test make test - DEVNULLRIGHTS=test make test
- name: gcc-6 + gcc-7 compilation - name: gcc-6 + gcc-7 compilation # ~ 3mn
script: script:
- make gcc6install gcc7install - make gcc6install gcc7install
- CC=gcc-6 CFLAGS=-Werror make -j all - CC=gcc-6 CFLAGS=-Werror make -j all
- make clean - make clean
- CC=gcc-7 CFLAGS=-Werror make -j all - CC=gcc-7 CFLAGS=-Werror make -j all
- name: gcc-8 + ASan + UBSan + Test Zstd - name: gcc-8 + ASan + UBSan + Test Zstd # ~6.5mn
script: script:
- make gcc8install - make gcc8install
- CC=gcc-8 CFLAGS="-Werror" make -j all - CC=gcc-8 CFLAGS="-Werror" make -j all
- make clean - make clean
- CC=gcc-8 make -j uasan-test-zstd </dev/null # test when stdin is not a tty - CC=gcc-8 make -j uasan-test-zstd </dev/null # test when stdin is not a tty
- name: gcc-6 + ASan + UBSan + Test Zstd, 32bit mode - name: gcc-6 + ASan + UBSan + Test Zstd, 32bit mode # ~4mn
script: script:
- make gcc6install libc6install - make gcc6install libc6install
- CC=gcc-6 CFLAGS="-Werror -m32" make -j all32 - CC=gcc-6 CFLAGS="-Werror -m32" make -j all32
- make clean - make clean
- CC=gcc-6 make -j uasan-test-zstd32 # note : can complain about pointer overflow - CC=gcc-6 make -j uasan-test-zstd32 # note : can complain about pointer overflow
- name: Trusty (clang-3.8 + MSan + Test Zstd) - name: clang-3.8 + MSan + Test Zstd # ~3.5mn
script: script:
- make clang38install - make clang38install
# External libraries must be turned off when using MSAN tests, # External libraries must be turned off when using MSAN tests,
@@ -66,7 +65,7 @@ matrix:
# so any data coming from these libraries is always considered "uninitialized" # so any data coming from these libraries is always considered "uninitialized"
- CC=clang-3.8 make clean msan-test-zstd HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0 - CC=clang-3.8 make clean msan-test-zstd HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0
- name: Trusty (Minimal Decompressor Macros) - name: Minimal Decompressor Macros # ~5mn
script: script:
- make clean - make clean
- CFLAGS=-Werror make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT" - CFLAGS=-Werror make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
@@ -81,63 +80,70 @@ matrix:
- make clean - make clean
- make -j check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" - make -j check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
- name: cmake test - name: cmake build check # ~2mn
script: script:
- make cmakebuild - make cmakebuild
- name: static analyzer scanbuild - name: static analyzer scanbuild # ~26mn
dist: trusty # note : it's important to pin down a version of static analyzer, since different versions report different false positives
script: script:
- make staticAnalyze - make staticAnalyze
- name: gcc-8 + ASan + UBSan + Fuzz Test - name: gcc-8 + ASan + UBSan + Fuzz Test # ~19mn
script: script:
- make gcc8install - make gcc8install
- CC=gcc-8 make clean uasan-fuzztest - CC=gcc-8 make clean uasan-fuzztest
- name: gcc-6 + ASan + UBSan + Fuzz Test 32bit - name: gcc-6 + ASan + UBSan + Fuzz Test 32bit # ~15.5mn
script: script:
- make gcc6install libc6install - make gcc6install libc6install
- CC=gcc-6 CFLAGS="-O2 -m32" make uasan-fuzztest # can complain about pointer overflow - CC=gcc-6 CFLAGS="-O2 -m32" make uasan-fuzztest # can complain about pointer overflow
- name: clang-3.8 + MSan + Fuzz Test - name: clang-3.8 + MSan + Fuzz Test # ~14.5mn
script: script:
- make clang38install - make clang38install
- CC=clang-3.8 make clean msan-fuzztest - CC=clang-3.8 make clean msan-fuzztest
- name: ASan + UBSan + MSan + Regression Test - name: ASan + UBSan + MSan + Regression Test # ~ 4.5mn
script: script:
- make -j uasanregressiontest - make -j uasanregressiontest
- make clean - make clean
- make -j msanregressiontest - make -j msanregressiontest
- name: Valgrind + Fuzz Test Stack Mode - name: C++, gnu90 and c99 compatibility # ~3mn
script:
- make cxxtest
- make clean
- make gnu90build
- make clean
- make c99build
- make clean
- make travis-install # just ensures `make install` works
- name: mingw cross-compilation
script :
- sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix;
- CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CFLAGS="-Werror -O1" make zstd
- name: Valgrind + Fuzz Test Stack Mode # ~ 7mn
script: script:
- make valgrindinstall - make valgrindinstall
- make -C tests clean valgrindTest - make -C tests clean valgrindTest
- make clean - make clean
- make -C tests test-fuzzer-stackmode - make -C tests test-fuzzer-stackmode
- name: Qemu ARM emulation + Fuzz Test - name: Qemu ARM emulation + Fuzz Test # ~13.5mn
script: script:
- make arminstall - make arminstall
- make armfuzz - make armfuzz
- name: Xenial (AARCH64 + Fuzz Test) - name: Qemu PPC + Fuzz Test # ~13mn
dist: xenial dist: trusty # it seems ppc cross-compilation fails on "current"
script:
- make arminstall
- make aarch64fuzz
- name: PPC + Fuzz Test
script: script:
- make ppcinstall - make ppcinstall
- make ppcfuzz - make ppcfuzz
- name: Versions Compatibility Test # check release number (release only)
script:
- make -C tests versionsTest
# check release number
- name: Tag-Specific Test - name: Tag-Specific Test
if: tag =~ ^v[0-9]\.[0-9] if: tag =~ ^v[0-9]\.[0-9]
script: script:
@@ -145,48 +151,45 @@ matrix:
- tests/checkTag "$TRAVIS_BRANCH" - tests/checkTag "$TRAVIS_BRANCH"
# tests for master branch and cron job only # tests for master branch and cron job only
- name: OS-X - name: OS-X # ~13mn
if: branch = master
os: osx os: osx
script: script:
- make test - make test
- name: thread sanitizer - name: Versions Compatibility Test # 11.5mn
if: branch = master
script:
- make -C tests versionsTest
- name: thread sanitizer # ~29mn
if: branch = master if: branch = master
script: script:
- make clang38install - make clang38install
- CC=clang-3.8 make tsan-test-zstream - CC=clang-3.8 make tsan-test-zstream
- CC=clang-3.8 make tsan-fuzztest - CC=clang-3.8 make tsan-fuzztest
- name: C++ and gnu90 compatibility - name: PPC64 # ~13mn
if: branch = master
script:
- make cxxtest
- make clean
- make gnu90build
- make clean
- make travis-install # just ensures `make install` works
- name: c99 compatibility
if: branch = master
script:
- make c99build
- make -C tests test-zstd
- name: PPC64
if: branch = master if: branch = master
script: script:
- make ppcinstall - make ppcinstall
- make ppc64fuzz - make ppc64fuzz
- name: zlib wrapper test # note : we already have aarch64 tests on hardware
- name: Qemu aarch64 + Fuzz Test (on Xenial) # ~14mn
if: branch = master
dist: xenial
script:
- make arminstall
- make aarch64fuzz
- name: zlib wrapper test # ~7.5mn
if: branch = master if: branch = master
script: script:
- make gpp6install valgrindinstall - make gpp6install valgrindinstall
- make -C zlibWrapper test - make -C zlibWrapper test
- make -C zlibWrapper valgrindTest - make -C zlibWrapper valgrindTest
- name: LZ4, thread pool, and partial libs tests - name: LZ4, thread pool, and partial libs tests # ~2mn
if: branch = master if: branch = master
script: script:
- make lz4install - make lz4install
@@ -197,8 +200,8 @@ matrix:
- bash tests/libzstd_partial_builds.sh - bash tests/libzstd_partial_builds.sh
# meson dedicated test # meson dedicated test
- name: Xenial (Meson + clang) - name: Xenial (Meson + clang) # ~8mn
# env: ALLOW_FAILURES=true if: branch = master
dist: xenial dist: xenial
language: cpp language: cpp
compiler: clang compiler: clang
+21 -13
View File
@@ -165,15 +165,15 @@ $(ZSTDDECOMP_O): CFLAGS += $(ALIGN_LOOP)
zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP) zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP)
zstd : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) $(DEBUGFLAGS_LD) zstd : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) $(DEBUGFLAGS_LD)
zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
ifneq (,$(filter Windows%,$(OS)))
zstd : $(RES_FILE)
endif
zstd : $(ZSTDLIB_FILES) zstdcli.o util.o timefn.o fileio.o benchfn.o benchzstd.o datagen.o dibio.o zstd : $(ZSTDLIB_FILES) zstdcli.o util.o timefn.o fileio.o benchfn.o benchzstd.o datagen.o dibio.o
@echo "$(THREAD_MSG)" @echo "$(THREAD_MSG)"
@echo "$(ZLIB_MSG)" @echo "$(ZLIB_MSG)"
@echo "$(LZMA_MSG)" @echo "$(LZMA_MSG)"
@echo "$(LZ4_MSG)" @echo "$(LZ4_MSG)"
ifneq (,$(filter Windows%,$(OS))) $(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
windres/generate_res.bat
endif
$(CC) $(FLAGS) $^ $(RES_FILE) -o $@$(EXT) $(LDFLAGS)
.PHONY: zstd-release .PHONY: zstd-release
zstd-release: DEBUGFLAGS := -DBACKTRACE_ENABLE=0 zstd-release: DEBUGFLAGS := -DBACKTRACE_ENABLE=0
@@ -183,11 +183,11 @@ zstd-release: zstd
zstd32 : CPPFLAGS += $(THREAD_CPP) zstd32 : CPPFLAGS += $(THREAD_CPP)
zstd32 : LDFLAGS += $(THREAD_LD) zstd32 : LDFLAGS += $(THREAD_LD)
zstd32 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) zstd32 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
zstd32 : $(ZSTDLIB_FILES) zstdcli.c util.c timefn.c fileio.c benchfn.c benchzstd.c datagen.c dibio.c
ifneq (,$(filter Windows%,$(OS))) ifneq (,$(filter Windows%,$(OS)))
windres/generate_res.bat zstd32 : $(RES32_FILE)
endif endif
$(CC) -m32 $(FLAGS) $^ $(RES32_FILE) -o $@$(EXT) zstd32 : $(ZSTDLIB_FILES) zstdcli.c util.c timefn.c fileio.c benchfn.c benchzstd.c datagen.c dibio.c
$(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
zstd-nolegacy : $(ZSTD_FILES) $(ZDICT_FILES) zstdcli.o util.o fileio.c benchfn.o benchzstd.o timefn.o datagen.o dibio.o zstd-nolegacy : $(ZSTD_FILES) $(ZDICT_FILES) zstdcli.o util.o fileio.c benchfn.o benchzstd.o timefn.o datagen.o dibio.o
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS) $(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
@@ -239,8 +239,16 @@ zstdmt: zstd
ln -sf zstd zstdmt ln -sf zstd zstdmt
.PHONY: generate_res .PHONY: generate_res
generate_res: generate_res: $(RES64_FILE) $(RES32_FILE)
windres/generate_res.bat
ifneq (,$(filter Windows%,$(OS)))
RC ?= windres
# http://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable
$(RES64_FILE): windres/zstd.rc
$(RC) -o $@ -I ../lib -I windres -i $< -O coff -F pe-x86-64
$(RES32_FILE): windres/zstd.rc
$(RC) -o $@ -I ../lib -I windres -i $< -O coff -F pe-i386
endif
.PHONY: clean .PHONY: clean
clean: clean:
@@ -346,10 +354,10 @@ INSTALL_MAN ?= $(INSTALL_DATA)
install: zstd install: zstd
@echo Installing binaries @echo Installing binaries
@$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MAN1DIR)/ @$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MAN1DIR)/
@$(INSTALL_PROGRAM) zstd $(DESTDIR)$(BINDIR)/zstd @$(INSTALL_PROGRAM) zstd$(EXT) $(DESTDIR)$(BINDIR)/zstd$(EXT)
@ln -sf zstd $(DESTDIR)$(BINDIR)/zstdcat @ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdcat$(EXT)
@ln -sf zstd $(DESTDIR)$(BINDIR)/unzstd @ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/unzstd$(EXT)
@ln -sf zstd $(DESTDIR)$(BINDIR)/zstdmt @ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdmt$(EXT)
@$(INSTALL_SCRIPT) zstdless $(DESTDIR)$(BINDIR)/zstdless @$(INSTALL_SCRIPT) zstdless $(DESTDIR)$(BINDIR)/zstdless
@$(INSTALL_SCRIPT) zstdgrep $(DESTDIR)$(BINDIR)/zstdgrep @$(INSTALL_SCRIPT) zstdgrep $(DESTDIR)$(BINDIR)/zstdgrep
@echo Installing man pages @echo Installing man pages
+1 -1
View File
@@ -41,7 +41,7 @@ extern "C" {
******************************************/ ******************************************/
#if defined(_WIN32) /* Windows */ #if defined(_WIN32) /* Windows */
#include <Windows.h> /* LARGE_INTEGER */ #include <windows.h> /* LARGE_INTEGER */
typedef LARGE_INTEGER UTIL_time_t; typedef LARGE_INTEGER UTIL_time_t;
#define UTIL_TIME_INITIALIZER { { 0, 0 } } #define UTIL_TIME_INITIALIZER { { 0, 0 } }
-11
View File
@@ -1,11 +0,0 @@
@echo off
REM http://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable
where /q windres.exe
IF ERRORLEVEL 1 (
ECHO The windres.exe is missing. Ensure it is installed and placed in your PATH.
EXIT /B
) ELSE (
windres.exe -I ../lib -I windres -i windres/zstd.rc -O coff -F pe-x86-64 -o windres/zstd64.res
windres.exe -I ../lib -I windres -i windres/zstd.rc -O coff -F pe-i386 -o windres/zstd32.res
)