| 1 | #!/bin/sh |
| 2 | |
| 3 | ### Exit immediately if a command exits with a non-zero status |
| 4 | set -e |
| 5 | |
| 6 | ### Get temporary directory and change to it |
| 7 | tmpdir=$(mktemp --directory) |
| 8 | cd $tmpdir |
| 9 | |
| 10 | ### Copy all distributed exemples here |
| 11 | cp /usr/share/doc/librsb-dev/examples/* . |
| 12 | |
| 13 | ### Compile them |
| 14 | echo "***** Compiling the sources..." |
| 15 | ./make.sh |
| 16 | |
| 17 | ### Run the examples |
| 18 | echo "***** Running the examples..." |
| 19 | for s in *.c *.F90 ; do |
| 20 | p=$(basename $(basename $s .c) .F90) |
| 21 | echo "===== $p" |
| 22 | ./$p |
| 23 | done |
| 24 | |
| 25 | ### Do cleanup |
| 26 | cd .. |
| 27 | rm -rf $tempdir |