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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/bin/bash
# Load function print_info, print_warning, print_error and print_ok
source test_utils/test_utils.sh
available_options="
pthread
memory
ompt
openmp
posixio
mpi
"
# module_generator performance pptrace static
function usage {
>&2 echo "Available tests are : $available_options"
>&2 echo '"test/run list" print all the available tests on standard output'
>&2 echo '"test/run ALL" is a shortcut for "test/run $(test/run list)" and run all the tests'
}
if [[ "$@" == "" ]] ; then
usage
exit
fi
asked_options="$@"
if [[ "$asked_options" == "ALL" ]] ; then
asked_options="$available_options"
fi
if [[ "$asked_options" == "list" ]] ; then
echo "$available_options"
exit 0
fi
invalid_options=""
for opt in $asked_options ; do
found=false
for avail in $available_options ; do
if [[ $opt == $avail ]] ; then
found=true
fi
done
if [[ $found == false ]]; then
invalid_options+=$opt
fi
done
if [[ $invalid_options != "" ]] ; then
print_error "Invalid options found : \"$invalid_options\", available_options are : \"$available_options\""
exit 1
fi
success=0
for opt in $asked_options ; do
print_info $opt
(cd $opt ; ./run.sh)
if [[ $? == 0 ]] ; then
print_ok "Test $opt succeded"
else
print_error "Test $opt failed : $res"
success=1
fi
done
exit $success
|