Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test_all.sh

    r04e61a r490038  
    11#!/bin/bash
    22
    3 optimizations=("-O0"\
     3optimizations=("-g3"\
     4               "-O0"\
    45               "-O1"\
    56               "-O2"\
     
    4950}
    5051
     52function logdate()
     53{
     54  echo -e "Launched on `date`.\n\n" >> $logfile 2>&1;
     55}
     56
     57
    5158while getopts “ho:f:j:scO:t:p:” OPTION
    5259do
     
    105112function configure(){
    106113  echo "Configuring";
    107   CXXFLAGS="$2" $1/configure --prefix=$PWD >> $logfile 2>&1;
     114  $1/configure $3 --prefix=$PWD CXXFLAGS="-Wall $2" >> $logfile 2>&1;
    108115}
    109116
     
    111118  echo "Making";
    112119  if [ $noprocs -gt 1 ]; then
    113     make -j$noprocs all install >>$logfile 2>&1;
    114   else
    115     make all install >>$logfile 2>&1;
     120    make -j$noprocs all >>$logfile 2>&1;
     121  else
     122    make all >>$logfile 2>&1;
    116123  fi
    117124}
     
    134141    then
    135142      echo -n "    $test: " >> $outfile;
    136       valgrind -v --error-exitcode=255 $test >> $logfile 2>&1;
     143      valgrind -v --leak-check=full --leak-resolution=high --show-reachable=yes --error-exitcode=255 $test >> $logfile 2>&1;
    137144      if [ $? ]
    138145      then
     
    149156function test(){
    150157
    151   echo "Testing with \"$2\"";
     158  echo "Testing with \"$2 $3\"";
    152159  echo "" >> $logfile;
    153160  echo "" >> $logfile;
    154161  echo "" >> $logfile;
    155   echo "Testing with \"$2\"" >> $logfile;
    156 
    157   echo -n "  Configuring: " >> $outfile;
    158   if configure "$1" "$2"
     162  echo "Testing with \"$2 $3\"" >> $logfile;
     163
     164  if [ x"$2" == x"-g3" ]
     165  then
     166    valgrind="--with-valgrind"
     167  else
     168    valgrind="--without-valgrind"
     169  fi
     170  echo -n "  Configuring $valgrind: " >> $outfile;
     171  if configure "$1" "$2 $3" "$valgrind"
    159172  then
    160173    echo "OK" >> $outfile;
     
    201214
    202215function run(){
    203   echo "Testing with \"$1\":" >> $outfile;
     216  echo "Testing with \"$1 $2\":" >> $outfile;
    204217  testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`;
    205218  basedir=$PWD;
    206219  cd $testdir;
    207   test "$basedir" "$1";
     220  test "$basedir" "$1" "$2";
    208221  cd $basedir;
    209222  rm -rf $testdir;
     
    220233  for option in "${options[@]}"
    221234  do
    222     run "$optimization $option";
     235    run "$optimization" "$option";
    223236  done
    224237done
Note: See TracChangeset for help on using the changeset viewer.