diff --git a/.travis.yml b/.travis.yml index b1ffa799..6cd3f5f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,85 +6,82 @@ matrix: # Container-based Ubuntu 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes) - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM=travis-install + env: PLATFORM="Ubuntu 12.04 container" CMD="make travis-install" - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM=cmaketest + env: PLATFORM="Ubuntu 12.04 container" CMD="make cmaketest" - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM=test + env: PLATFORM="Ubuntu 12.04 container" CMD="make test" - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM="-C programs test-zstd_nolegacy" + env: PLATFORM="Ubuntu 12.04 container" CMD="make -C programs test-zstd_nolegacy" - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM=usan + env: PLATFORM="Ubuntu 12.04 container" CMD="make usan" - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM=asan + env: PLATFORM="Ubuntu 12.04 container" CMD="make asan" - os: linux sudo: false - env: PLATFORM="Ubuntu 12.04 container" MAKE_PARAM=zlibwrapper + env: PLATFORM="Ubuntu 12.04 container" CMD="make zlibwrapper" # Standard Ubuntu 12.04 LTS Server Edition 64 bit - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=clangtest + env: PLATFORM="Ubuntu 12.04" CMD="make libc6install clangtest" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=gpptest + env: PLATFORM="Ubuntu 12.04" CMD="make gppinstall gpptest" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=gnu90test + env: PLATFORM="Ubuntu 12.04" CMD="make libc6install gnu90test" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=c99test + env: PLATFORM="Ubuntu 12.04" CMD="make libc6install c99test" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=gnu99test + env: PLATFORM="Ubuntu 12.04" CMD="make libc6install gnu99test" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=armtest-w-install + env: PLATFORM="Ubuntu 12.04" CMD="make arminstall armtest" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM="-C programs test32" + env: PLATFORM="Ubuntu 12.04" CMD="make libc6install && make -C programs test32" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM="-C tests versionsTest" + env: PLATFORM="Ubuntu 12.04" CMD="make -C tests versionsTest" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM=asan32 + env: PLATFORM="Ubuntu 12.04" CMD="make libc6install asan32" - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" MAKE_PARAM="-C programs valgrindTest" + env: PLATFORM="Ubuntu 12.04" CMD="make valgrindinstall && make -C programs valgrindTest" # Ubuntu 14.04 LTS Server Edition 64 bit - os: linux dist: trusty sudo: required - env: PLATFORM="Ubuntu 14.04" MAKE_PARAM=ppctest-w-install + env: PLATFORM="Ubuntu 14.04" CMD="make gcc5install gcc5test" - os: linux dist: trusty sudo: required - env: PLATFORM="Ubuntu 14.04" MAKE_PARAM=zlibwrapper + env: PLATFORM="Ubuntu 14.04" CMD="make gcc6install gcc6test" + - os: linux + dist: trusty + sudo: required + env: PLATFORM="Ubuntu 14.04" CMD="make ppcinstall ppctest" + - os: linux + dist: trusty + sudo: required + env: PLATFORM="Ubuntu 14.04" CMD="make zlibwrapper" # OS X Mavericks - os: osx - env: PLATFORM="OS X Mavericks" MAKE_PARAM=travis-install + env: PLATFORM="OS X Mavericks" CMD="make travis-install" - os: osx - env: PLATFORM="OS X Mavericks" MAKE_PARAM=gnu90test + env: PLATFORM="OS X Mavericks" CMD="make gnu90test" - os: osx - env: PLATFORM="OS X Mavericks" MAKE_PARAM=test + env: PLATFORM="OS X Mavericks" CMD="make test" exclude: - compiler: gcc -before_install: - - set -e - - | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - CAN_I_RUN_SUDO=$(sudo -n uptime 2>&1|grep "load"|wc -l) - echo "CAN_I_RUN_SUDO=$CAN_I_RUN_SUDO\n" - if [ ${CAN_I_RUN_SUDO} -gt 0 ]; then - sudo apt-get install -y -qq clang g++-multilib gcc-multilib valgrind - fi - fi - script: - - make $MAKE_PARAM + - sh -c "$CMD" diff --git a/Makefile b/Makefile index f0d39ea1..42845288 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ all: zstdprogram: $(MAKE) -C $(PRGDIR) - mv $(PRGDIR)/zstd . + cp $(PRGDIR)/zstd . zlibwrapper: $(MAKE) -C $(ZSTDDIR) all @@ -87,6 +87,14 @@ travis-install: gpptest: clean $(MAKE) all CC=g++ CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" +gcc5test: clean + gcc-5 -v + $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror" + +gcc6test: clean + gcc-6 -v + $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" + clangtest: clean clang -v $(MAKE) all CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion" @@ -95,35 +103,13 @@ armtest: clean $(MAKE) -C $(PRGDIR) datagen # use native, faster $(MAKE) -C $(PRGDIR) test CC=arm-linux-gnueabi-gcc ZSTDRTTEST= MOREFLAGS="-Werror -static" -# for Travis CI -arminstall: clean - sudo apt-get install -y -q qemu binfmt-support qemu-user-static gcc-arm-linux-gnueabi - -# for Travis CI -armtest-w-install: clean arminstall armtest - ppctest: clean $(MAKE) -C $(PRGDIR) datagen # use native, faster $(MAKE) -C $(PRGDIR) test CC=powerpc-linux-gnu-gcc ZSTDRTTEST= MOREFLAGS="-Werror -static" -# for Travis CI -ppcinstall: clean - # sudo apt-get update -y -q - sudo apt-get install -y -q qemu-system-ppc binfmt-support qemu-user-static gcc-powerpc-linux-gnu # doesn't work with Ubuntu 12.04 - -# for Travis CI -ppctest-w-install: clean ppcinstall ppctest - ppc64test: clean $(MAKE) -C $(PRGDIR) datagen # use native, faster - $(MAKE) -C $(PRGDIR) test CC=powerpc64le-linux-gnu-gcc ZSTDRTTEST= MOREFLAGS="-Werror -static" - -ppc64install: clean - sudo apt-get update -y -q - sudo apt-get install -y -q qemu-ppc64le binfmt-support qemu-user-static gcc-powerpc64le-linux-gnu - update-binfmts --displ - -ppc64test-w-install: clean ppc64install ppc64test + $(MAKE) -C $(PRGDIR) test CC=powerpc-linux-gnu-gcc ZSTDRTTEST= MOREFLAGS="-m64 -Werror -static" usan: clean $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=undefined" @@ -183,3 +169,37 @@ bmix32test: clean bmi32test: clean CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(PRGDIR) test endif + + +#------------------------------------------------------------------------ +# for Travis CI +#------------------------------------------------------------------------ +libc6install: + sudo apt-get install -y -qq libc6-dev-i386 + +gppinstall: + sudo apt-get install -y -qq g++-multilib + +gcc5install: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + sudo apt-get install -y -qq gcc-5-multilib + +gcc6install: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + sudo apt-get install -y -qq gcc-6-multilib + +arminstall: clean + sudo apt-get install -y -q qemu binfmt-support qemu-user-static gcc-arm-linux-gnueabi + +ppcinstall: clean + sudo apt-get install -y -q qemu-system-ppc binfmt-support qemu-user-static gcc-powerpc-linux-gnu # doesn't work with Ubuntu 12.04 + +ppc64install: clean # compilation works but cannot be executed + sudo apt-get install -y -q qemu-system-ppc binfmt-support qemu-user-static gcc-powerpc-linux-gnu + update-binfmts --displ + +valgrindinstall: + echo sudo apt-get install -y -qq valgrind + sudo apt-get install -y -qq valgrind diff --git a/programs/bench.c b/programs/bench.c index 51d47bde..04f4276c 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -42,10 +42,6 @@ /* ************************************* * Constants ***************************************/ -#ifndef ZSTD_VERSION -# define ZSTD_VERSION "" -#endif - #define NBLOOPS 3 #define TIMELOOP_MICROSEC 1*1000000ULL /* 1 second */ #define ACTIVEPERIOD_MICROSEC 70*1000000ULL /* 70 seconds */ @@ -363,7 +359,7 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize, memset(&total, 0, sizeof(total)); if (g_displayLevel == 1 && !g_additionalParam) - DISPLAY("bench %s: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10)); + DISPLAY("bench %s: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION_STRING, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10)); if (cLevelLast < cLevel) cLevelLast = cLevel; diff --git a/tests/test-zstd-speed.py b/tests/test-zstd-speed.py index 9a9a3992..5cc07fb3 100755 --- a/tests/test-zstd-speed.py +++ b/tests/test-zstd-speed.py @@ -8,9 +8,9 @@ import time import traceback from subprocess import Popen, PIPE -repo_url = 'https://github.com/Cyan4973/zstd.git' +default_repo_url = 'https://github.com/Cyan4973/zstd.git' test_dir_name = 'speedTest' - +email_header = '[ZSTD_speedTest]' def log(text): print time.strftime("%Y/%m/%d %H:%M:%S") + ' - ' + text @@ -126,14 +126,23 @@ def benchmark_and_compare(branch, commit, resultsFileName, lastCLevel, testFileP return text +def send_simple_email(emails, email_topic, have_mutt, have_mail): + if have_mutt: + execute('mutt -s "' + email_header + ' ' + email_topic + '" ' + emails + '