From 993dd2858e103a56986d30a280176a2213f12757 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Fri, 27 Apr 2012 18:48:52 +0200 Subject: [PATCH 1/2] added unittests.sh --- build.sh | 37 +----------------- unittests.sh | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 35 deletions(-) create mode 100755 unittests.sh diff --git a/build.sh b/build.sh index 724dc461d5..372e552872 100755 --- a/build.sh +++ b/build.sh @@ -3,19 +3,18 @@ echo "########################################################" echo "# build.sh #" echo "########################################################" +echo . config/detect_distro.sh OPTIONS="--disable-dependency-tracking --disable-relative" PREFIX="--prefix=/usr --sysconfdir=/etc" -RESULTS="avocado avocsh" +RESULTS="avocado avocsh avocirb" export CPPFLAGS="" export LDFLAGS="" export MAKEJ=2 export LDD_INFO="no" -export VALGRIND_TEST="no" -export RSPEC_AVAILABLE="yes" echo echo "########################################################" @@ -34,7 +33,6 @@ case $TRI_OS_LONG in Linux-openSUSE-11*) echo "Using configuration for openSuSE 11" OPTIONS="$OPTIONS --enable-all-in-one" - VALGRIND_TEST="yes" LDD_INFO="yes" ;; @@ -48,14 +46,12 @@ case $TRI_OS_LONG in echo "Using configuration for Debian" OPTIONS="$OPTIONS --enable-all-in-one" LDD_INFO="yes" - RSPEC_AVAILABLE="no" ;; Linux-CentOS-*) echo "Using configuration for Centos" OPTIONS="$OPTIONS --enable-all-in-one" LDD_INFO="yes" - RSPEC_AVAILABLE="no" ;; Linux-Ubuntu-11.10*) @@ -123,32 +119,3 @@ for result in $RESULTS; do echo fi done - -echo - -echo -echo "########################################################" -echo "unittests:" -echo " make unittests" -echo "########################################################" -echo - -make unittests-boost || exit 1 -make unittests-shell-server || exit 1 - -if text "x$RSPEC_AVAILABLE" = "xyes"; then - make unittests-http-server || exit 1 -fi - -make unittests-shell-client || exit 1 - -if test "x$VALGRIND_TEST" = "xyes"; then - echo - echo "########################################################" - echo "unittests with VALGRIND:" - echo " make unittests VALGRIND=valgrind --leak-check=full" - echo "########################################################" - echo - - make unittests VALGRIND="valgrind --leak-check=full" || exit 1 -fi diff --git a/unittests.sh b/unittests.sh new file mode 100755 index 0000000000..6f3f911bda --- /dev/null +++ b/unittests.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +echo "########################################################" +echo "# build.sh #" +echo "########################################################" +echo + +. config/detect_distro.sh + +export VALGRIND_TEST="no" +export RSPEC_AVAILABLE="yes" + +echo +echo "########################################################" +echo "Building on $TRI_OS_LONG" +echo "########################################################" +echo + +case $TRI_OS_LONG in + + Linux-openSUSE-11.4*) + echo "Using configuration for openSuSE 11.4" + ;; + + Linux-openSUSE-11*) + echo "Using configuration for openSuSE 11" + VALGRIND_TEST="yes" + ;; + + Linux-Debian-6*) + echo "Using configuration for Debian" + ;; + + Linux-Debian*) + echo "Using configuration for Debian" + RSPEC_AVAILABLE="no" + ;; + + Linux-CentOS-*) + echo "Using configuration for Centos" + RSPEC_AVAILABLE="no" + ;; + + Linux-Ubuntu-11.10*) + echo "Using configuration for Ubuntu" + ;; + + Linux-Ubuntu-*) + echo "Using configuration for Ubuntu" + ;; + + Darwin*) + echo "Using configuration for DARWIN" + ;; + + *) + echo "Using default configuration" + ;; + +esac + +while [ $? -ne 0 ]; do + if [ "$1" == "--valgrind" ]; then + VALGRIND_TEST="yes" + elif [ "$1" == "--no-valgrind" ]; then + VALGRIND_TEST="no" + elif [ "$1" == "--resc" ]; then + RSPEC_AVAILABLE="yes" + elif [ "$1" == "--no-resc" ]; then + RSPEC_AVAILABLE="no" + fi + + shift +done + +echo +echo "########################################################" +echo "unittests:" +echo " make unittests" +echo "########################################################" +echo + +echo "VALGRIND: $VALGRIND_TEST" +echo "RSPEC: $RSPEC_AVAILABLE" + +make unittests-boost || exit 1 +make unittests-shell-server || exit 1 +make unittests-shell-server-ahuacatl || exit 1 + +if test "x$RSPEC_AVAILABLE" = "xyes"; then + make unittests-http-server || exit 1 +fi + +make unittests-shell-client || exit 1 + +if test "x$VALGRIND_TEST" = "xyes"; then + echo + echo "########################################################" + echo "unittests with VALGRIND:" + echo " make unittests VALGRIND=valgrind --leak-check=full" + echo "########################################################" + echo + + make unittests VALGRIND="valgrind --suppressions=RestServer/avocado.supp --leak-check=full" || exit 1 +fi From debd3607823fc10a545cf1f0c6df35bac6989d13 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Sat, 28 Apr 2012 19:15:21 +0200 Subject: [PATCH 2/2] now ruby --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 372e552872..2caf9f09cb 100755 --- a/build.sh +++ b/build.sh @@ -44,13 +44,13 @@ case $TRI_OS_LONG in Linux-Debian*) echo "Using configuration for Debian" - OPTIONS="$OPTIONS --enable-all-in-one" + OPTIONS="$OPTIONS --enable-all-in-one --disable-mruby" LDD_INFO="yes" ;; Linux-CentOS-*) echo "Using configuration for Centos" - OPTIONS="$OPTIONS --enable-all-in-one" + OPTIONS="$OPTIONS --enable-all-in-one --disable-mruby" LDD_INFO="yes" ;;