| 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca> |
| 4 | # |
| 5 | # This program is free software; you can redistribute it and/or |
| 6 | # modify it under the terms of the GNU General Public License |
| 7 | # as published by the Free Software Foundation; either version 2 |
| 8 | # of the License, or (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | # |
| 19 | |
| 20 | TEST_DIR=$(dirname $0) |
| 21 | |
| 22 | failed=0 |
| 23 | num_test=1 |
| 24 | |
| 25 | function run() { |
| 26 | printf "%d) Running test $@\n" $num_test |
| 27 | echo "==================================" |
| 28 | |
| 29 | # Running test |
| 30 | ./$@ |
| 31 | if [ $? -ne 0 ]; then |
| 32 | let failed=$failed+1 |
| 33 | printf "\nTest $@ FAILED\n\n" |
| 34 | else |
| 35 | printf "\nTest $@ PASSED\n\n" |
| 36 | fi |
| 37 | |
| 38 | let num_test=$num_test+1 |
| 39 | } |
| 40 | |
| 41 | #### ADD TESTS HERE #### |
| 42 | |
| 43 | #### END TESTS HERE #### |
| 44 | |
| 45 | echo "--------------------------" |
| 46 | if [ $failed -eq 0 ]; then |
| 47 | echo "All passed!" |
| 48 | else |
| 49 | echo "$failed tests failed" |
| 50 | fi |
| 51 | echo "--------------------------" |
| 52 | |
| 53 | exit 0 |