3 # helper script to run some predefined set of tests
4 # store results in a file that contains the git hash
5 # and also shows differences if any
7 # if this command is run as all-tests3, then we will just do
10 # xxx - WARNING : most likely the python2 and python3 tests
11 # cannot safely be run together; need to check the nepi exp_ids
15 COMMAND=$(basename $0)
17 if echo $COMMAND | grep -q 6; then
18 $DIRNAME/all-tests2; $DIRNAME/all-tests3; exit
23 echo $COMMAND | grep -q 3 && { PYTHON=python3; version=3; }
25 hash=$(git log -n 1 | head -1 | sed -e 's,commit ,,' -e 's,\(........\).*,\1,')
27 # compute output file name
28 output="zz.$hash.py$version"
29 latest="zz.latest.py$version"
31 # if there is any pending change, use another name
33 changes=$(git diff HEAD | wc -l); changes=$(echo $changes)
34 [ "$changes" == 0 ] && is_pristine=true
35 [ -n "$is_pristine" ] || output="$output-pending"
37 function all_tests () {
38 echo all-tests : begin at; date
40 echo ========================================
42 echo ========================================
43 echo ===== Current hash $hash
44 echo ===== Current branch
46 echo ===== Uncommitted changes
48 echo ========================================
50 echo ========================================
51 make PYTHON=$PYTHON all-tests
53 echo ========================================
55 echo all-tests : end at $((date)); echo total duration $(($end-$begin)) seconds
60 # the current code for analyzing the output is very basic
61 # this needs to be checked manually for some time
63 # create a 'latest' symlink
64 ln -f -s $output $latest
69 # analyze this output for success or not
70 success=$output.success
71 failure=$output.failed
73 if [ "$retcod" != 0 ]; then
75 elif grep -q '^FAIL' $output; then