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
8 targets="test-node test-app"
10 hash=$(git log -n 1 | head -1 | sed -e 's,commit ,,' -e 's,\(........\).*,\1,')
12 # compute output file name
13 output="all-tests.$hash"
15 # if there is any pending change, use another name
17 changes=$(git diff HEAD | wc -l); changes=$(echo $changes)
18 [ "$changes" == 0 ] && is_pristine=true
19 [ -n "$is_pristine" ] || output="$output-pending"
21 function all_tests () {
22 echo all-tests : begin at; date
24 echo ========================================
26 echo ========================================
27 echo ===== Current hash $hash
28 echo ===== Current branch
30 echo ===== Uncommitted changes
32 echo ========================================
34 echo ========================================
36 echo ========================================
38 echo all-tests : end at; date; echo total duration $(($end-$begin)) seconds
44 # analyze this output for success or not
45 success=$output.success
46 failure=$output.failed
48 if [ "$retcod" != 0 ]; then
50 elif grep -q '^FAIL' $output; then