Ignore:
Timestamp:
Jan 12, 2013 11:56:53 AM (7 years ago)
Author:
bradbell
Message:

Use build instead of work directory for building.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/check_all.sh

    r2725 r2740  
    1616        exit 1
    1717fi
    18 echo_eval() {
    19      echo $*
    20      eval $*
     18echo_log_eval() {
     19        echo $*
     20        echo $* >> $top_srcdir/check_all.log
     21        if ! eval $* >> $top_srcdir/check_all.log
     22        then
     23                echo "Error: check check_all.log"
     24                exit 1
     25        fi
    2126}
    22 echo_eval_log() {
    23         echo "$* >> check_all.log"
     27log_eval() {
    2428        echo $* >> $top_srcdir/check_all.log
    25         eval $* >> $top_srcdir/check_all.log
     29        if ! eval $* >> $top_srcdir/check_all.log
     30        then
     31                echo "Error: check check_all.log"
     32                exit 1
     33        fi
    2634}
     35if [ -e check_all.log ]
     36then
     37        echo "rm check_all.log"
     38        rm check_all.log
     39fi
     40top_srcdir=`pwd`
     41# ---------------------------------------------------------------------------
    2742# circular shift program list and set program to first entry in list
    2843next_program() {
     
    3045        program=`echo "$program_list" | sed -e 's| *\([^ ]*\).*|\1|'`
    3146}
    32 if [ -e 'check_all.log' ]
    33 then
    34         echo_eval rm check_all.log
    35 fi
    36 top_srcdir=`pwd`
     47# ---------------------------------------------------------------------------
    3748cmake_args=''
    3849if [ "$1" != "" ]
     
    4859# -----------------------------------------------------------------------------
    4960# Create package to run test in
    50 echo_eval bin/package.sh
     61echo "bin/package.sh"
     62bin/package.sh
    5163# -----------------------------------------------------------------------------
    5264# choose which tarball to use for testing
    5365version=`bin/version.sh get`
    54 cd work
     66echo_log_eval cd build
    5567list=( `ls cppad-$version.*.tgz` )
    5668if [ "${#list[@]}" == '1' ]
     
    6274        tarball="${list[$choice]}"
    6375fi
    64 echo_eval rm -r cppad-$version
    65 echo_eval tar -xzf $tarball
    66 echo_eval cd cppad-$version
     76echo_log_eval rm -r cppad-$version
     77echo_log_eval tar -xzf $tarball
     78echo_log_eval cd cppad-$version
    6779# -----------------------------------------------------------------------------
    6880list="
    69         check_all.log
    7081        $HOME/prefix/cppad
    71         work
     82        build
    7283"
    7384for name in $list
     
    7586        if [ -e "$name" ]
    7687        then
    77                 echo_eval rm -r $name
    78         fi
    79 done
    80 echo_eval mkdir work
    81 echo_eval cd work
     88                echo_log_eval rm -r $name
     89        fi
     90done
     91echo_log_eval mkdir build
     92echo_log_eval cd build
    8293# -----------------------------------------------------------------------------
    8394cmake_args="$cmake_args  -D cmake_install_prefix=$HOME/prefix/cppad"
     
    117128#
    118129#
    119 echo_eval_log cmake $cmake_args ..
    120 # -----------------------------------------------------------------------------
    121 echo_eval_log make check
     130echo_log_eval cmake $cmake_args ..
     131# -----------------------------------------------------------------------------
     132echo_log_eval make check
    122133# -----------------------------------------------------------------------------
    123134skip=''
     
    141152                skip="$skip $program"
    142153        else
    143                 echo_eval_log $program
     154                echo_log_eval $program
    144155        fi
    145156done
     
    153164                skip="$skip $program"
    154165        else
    155                 echo_eval_log $program correct 54321
    156                 echo_eval_log $program correct 54321 retape
     166                echo_log_eval $program correct 54321
     167                echo_log_eval $program correct 54321 retape
    157168        fi
    158169done
     
    171182                #
    172183                # fast cases, test for all programs
    173                 echo_eval_log ./$program a11c
    174                 echo_eval_log ./$program simple_ad
    175                 echo_eval_log ./$program team_example
     184                echo_log_eval ./$program a11c
     185                echo_log_eval ./$program simple_ad
     186                echo_log_eval ./$program team_example
    176187        fi
    177188done
     
    180191        # test_time=1,max_thread=4,mega_sum=1
    181192        next_program
    182         echo_eval_log ./$program harmonic 1 4 1
     193        echo_log_eval ./$program harmonic 1 4 1
    183194        #
    184195        # test_time=2,max_thread=4,num_zero=20,num_sub=30,num_sum=500,use_ad=true
    185196        next_program
    186         echo_eval_log ./$program multi_newton 2 4 20 30 500 true
     197        echo_log_eval ./$program multi_newton 2 4 20 30 500 true
    187198        #
    188199        # case that failed in the past
    189200        next_program
    190         echo_eval_log ./$program multi_newton 1 1 100 700 1 true
     201        echo_log_eval ./$program multi_newton 1 1 100 700 1 true
    191202        #
    192203        # case that failed in the past
    193204        next_program
    194         echo_eval_log ./$program multi_newton 1 2 3 12 1 true
     205        echo_log_eval ./$program multi_newton 1 2 3 12 1 true
    195206fi
    196207#
     
    200211        skip="$skip print_for/print_for"
    201212else
    202         echo_eval_log print_for/print_for
     213        echo_log_eval print_for/print_for
    203214        print_for/print_for | sed -e '/^Test passes/,$d' > junk.1.$$
    204215        print_for/print_for | sed -e '1,/^Test passes/d' > junk.2.$$
     
    206217        then
    207218                rm junk.1.$$ junk.2.$$
    208                 echo "print_for: OK"  >> $top_srcdir/check_all.log
    209         else
    210                 echo "print_for: Error"  >> $top_srcdir/check_all.log
    211                 exit 1
    212         fi
    213 fi
    214 #
    215 echo_eval_log make install
     219                echo_log_eval echo "print_for: OK" 
     220        else
     221                echo_log_eval echo "print_for: Error"
     222                exit 1
     223        fi
     224fi
     225#
     226echo_log_eval make install
    216227#
    217228if [ "$skip" != '' ]
    218229then
    219         echo "check_all.sh: skip = $skip"
     230        echo_log_eval echo "check_all.sh: skip = $skip"
    220231        exit 1
    221232fi
    222233#
    223 echo 'check_all.sh: OK'
     234echo_log_eval echo 'check_all.sh: OK'
    224235exit 0
Note: See TracChangeset for help on using the changeset viewer.