From 392d3dde0bc852c1269e36691c5470aa749a75eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 26 Jan 2015 14:03:56 +0000 Subject: [PATCH] Adapt all.sh for OS X (no MemSan) --- tests/scripts/all.sh | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 790af5b76..fb0fe2685 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -6,8 +6,8 @@ # CMake configuration. After this script is run, the CMake cache is lost and # CMake is not initialised any more! # -# Assumes gcc and clang (recent enough for using ASan with gcc and MemSen with -# clang) are available, as well as cmake and GNU find. +# Assumes gcc and clang (recent enough for using ASan with gcc and MemSan with +# clang, or valgrind) are available, as well as cmake and a "good" find. # Abort on errors (and uninitiliased variables) set -eu @@ -25,7 +25,7 @@ MEMORY=0 while [ $# -gt 0 ]; do case "$1" in -m*) - MEMORY=1 + MEMORY=${1#-m} ;; *) echo "Unknown argument: '$1'" >&2 @@ -58,7 +58,7 @@ msg() echo "" echo "******************************************************************" echo "* $1 " - echo -n "* "; date + printf "* "; date echo "******************************************************************" } @@ -130,6 +130,9 @@ msg "build: Unix make, -O2 (gcc)" # ~ 30s cleanup CC=gcc make +# MemSan currently only available on Linux +if [ `uname` = 'Linux' ]; then + msg "build: MSan (clang)" # ~ 1 min 20s cleanup cp "$CONFIG_H" "$CONFIG_BAK" @@ -155,6 +158,36 @@ if [ "$MEMORY" -gt 0 ]; then cd .. fi +else # no MemSan + +msg "build: Release (clang)" +cleanup +CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release . +make + +msg "test: main suites valgrind (Release)" +make test + +# Optional part(s) +# Currently broken, programs don't seem to receive signals +# under valgrind on OS X + +if [ "$MEMORY" -gt 0 ]; then + msg "test: ssl-opt.sh --memcheck (Release)" + cd tests + ./ssl-opt.sh --memcheck + cd .. +fi + +if [ "$MEMORY" -gt 1 ]; then + msg "test: compat.sh --memcheck (Release)" + cd tests + ./compat.sh --memcheck + cd .. +fi + +fi # MemSan + msg "Done, cleaning up" cleanup