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
14 COMMAND=$(basename $0)
18 echo $COMMAND | grep -q 3 && { PYTHON=python3; version=3; }
20 hash=$(git log -n 1 | head -1 | sed -e 's,commit ,,' -e 's,\(........\).*,\1,')
22 # compute output file name
23 output="zz.py$version.$hash"
25 # if there is any pending change, use another name
27 changes=$(git diff HEAD | wc -l); changes=$(echo $changes)
28 [ "$changes" == 0 ] && is_pristine=true
29 [ -n "$is_pristine" ] || output="$output-pending"
31 function all_tests () {
32 echo all-tests : begin at; date
34 echo ========================================
36 echo ========================================
37 echo ===== Current hash $hash
38 echo ===== Current branch
40 echo ===== Uncommitted changes
42 echo ========================================
44 echo ========================================
45 make PYTHON=$PYTHON all-tests
46 echo ========================================
48 echo all-tests : end at; date; echo total duration $(($end-$begin)) seconds
51 # WARNING: the current code for analyzing the output is not quite right
52 # I've seen cases where the tests session goes very badly - with broken imports for example
53 # but it's considered OK though
54 # we mght wish to take the opposite angle : check we have as many OK as expected
55 # but then the list of default targets should be declared here and not in Makefile
56 # in any case this is good enough for now
61 # analyze this output for success or not
62 success=$output.success
63 failure=$output.failed
65 if [ "$retcod" != 0 ]; then
67 elif grep -q '^FAIL' $output; then