File: run_all_tests_unix.sh

package info (click to toggle)
libterralib 4.3.0%2Bdfsg.2-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 61,560 kB
  • ctags: 37,110
  • sloc: cpp: 225,052; ansic: 31,562; makefile: 807; sh: 80; xml: 37
file content (48 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

echo Starting test procedure...
echo The current directory is:
pwd

echo Cleanning garbage files...
find -name "*.tif" -exec rm -f {} \;
find -name "*.ilk" -exec rm -f {} \;
find -name "*.pdb" -exec rm -f {} \;
find -name "*.exe" -exec rm -f {} \;
echo Cleanning done.

TEST_FAILED=0
AT_LEAST_ONE_TEST_FAILED=0

for i in $( ls TePDI* ); do
  if [ -x $i ]; then
    echo Now running $i test ...
    
    TEST_FAILED=0
    /bin/nice -n +5 $i &> /tmp/terralibupdate.log
    
    if [ "$?" -ne "0" ]; then 
      TEST_FAILED=1
      AT_LEAST_ONE_TEST_FAILED=1
      echo Test $i failed.
    fi
    
    if [ -n "$1" ]; then
      echo ----------------------------------------------------------------
      cat /tmp/terralibupdate.log
      echo ----------------------------------------------------------------    
    else
      if [ $TEST_FAILED -eq "1" ]; then
        echo ----------------------------------------------------------------
        cat /tmp/terralibupdate.log
        echo ----------------------------------------------------------------    
      fi      
    fi
  fi
done
if [ $AT_LEAST_ONE_TEST_FAILED -ne "0" ]; then
  echo ----------------------------------------------------------------
  echo Test procedure finished with errors.
else
  echo Test procedure finished with no errors.
fi