Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test_all.sh

    rb21cb9 re24c78  
    2323docheck=0;
    2424docheck_mem=0;
     25if [ -n "$TMPDIR" ]
     26then
     27  tmpdir="$TMPDIR";
     28else
     29  tmpdir="/tmp";
     30fi
     31tmppattern="MolecuilderTest";
    2532
    2633function usage(){
     
    3643  echo "  -c                    Only configure and compile (implies -s)";
    3744  echo "  -O <opt-level>        Only compile this optimization level";
    38 }
    39 
    40 while getopts “ho:f:scO:” OPTION
     45  echo "  -t <tmpDir>           Use tmpDir as temporary directory";
     46  echo "  -p <prefix>           Prefix to use for directory names (standart MolecuilderTest)";
     47}
     48
     49while getopts “ho:f:scO:t:p:” OPTION
    4150do
    4251  case $OPTION in
     
    4655      ;;
    4756   o)
    48      outfile=$OPTARG;
     57     outfile="$OPTARG";
    4958     ;;
    5059   f)
    51      logfile=$OPTARG;
     60     logfile="$OPTARG";
    5261     ;;
    5362   s)
     
    6170     optimizations=("-O$OPTARG");
    6271     ;;
     72   t)
     73     tmpdir="$OPTARG";
     74     ;;
     75   p)
     76     tmppattern="$OPTARG";
     77     ;;
    6378   ?)
    6479     usage;
     
    6883done
    6984
    70 if [[ -z $outfile ]] || [[ -z $logfile ]]
     85# test if all arguments were provided
     86if [[ -z "$outfile" ]] || [[ -z "$logfile" ]] || [[ -z "$tmpdir" ]] || [[ -z "$tmppattern" ]]
    7187then
    7288  usage;
     
    7490fi
    7591
     92# turn all relative paths into absolutes
    7693outfile=`realpath -s $outfile`;
    7794logfile=`realpath -s $logfile`;
     95tmpdir=`realpath -s $tmpdir`;
    7896
    7997
     
    98116  echo "Valgrinding";
    99117  retval=0;
    100   for test in molecuilder/src/unittests/*
     118  for test in src/unittests/*
    101119  do
    102120    if [ -x "$test" ]
     
    119137
    120138  echo "Testing with \"$2\"";
     139  echo "" >> $logfile;
     140  echo "" >> $logfile;
     141  echo "" >> $logfile;
     142  echo "Testing with \"$2\"" >> $logfile;
    121143
    122144  echo -n "  Configuring: " >> $outfile;
     
    167189function run(){
    168190  echo "Testing with \"$1\":" >> $outfile;
    169   testdir=`mktemp -d --tmpdir MolecuilderTest.XXXXXXXXXX`;
     191  testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`;
    170192  basedir=$PWD;
    171193  cd $testdir;
Note: See TracChangeset for help on using the changeset viewer.