From 32bd8c4353de4ff7afff57b0fa79cf5af7d81be3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 17 Jun 2015 07:50:35 +0200 Subject: [PATCH] make preview script valgrind use suppression file, closing issue #154 --- s/build | 1 + s/preview | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/s/build b/s/build index 068a669a1..2f689a1f9 100755 --- a/s/build +++ b/s/build @@ -6,6 +6,7 @@ done [ -z $BUILD ] && BUILD=Debug MACHINE=`uname -m` +[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" [ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" [ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" diff --git a/s/preview b/s/preview index bb336a5f8..bafbae3ac 100755 --- a/s/preview +++ b/s/preview @@ -1,5 +1,12 @@ #!/bin/bash +MACHINE=`uname -m` +[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" +[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" +[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" +[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" +BUILD="build-$MACHINE-$CC-Debug" + function usage() { cat <] [-g ] [-f ] command [args] @@ -80,8 +87,8 @@ ln -f $LIVE/data/$turn.dat data/ rm -rf reports mkdir -p reports -SUPP="$SERVER/share/ubuntu-12_04.supp" -SERVER="$SOURCE/build-x86_64-gcc-Debug/eressea/eressea" +SUPP="$SOURCE/share/ubuntu-12_04.supp" +SERVER="$SOURCE/$BUILD/eressea/eressea" VALGRIND=$(which valgrind) if [ ! -z $VALGRIND ]; then SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER" @@ -148,7 +155,7 @@ case "$1" in ;; "run") if [ $turn -eq 0 ]; then - [ -f $LIVE/turn ] || abort "missing turn file, and no turn specified" + [ -f $LIVE/turn ] || abort "missing turn file in $LIVE, and no turn specified" let turn=$(cat $LIVE/turn)-1 fi run