tests: validate file existence of file to test before tests
authorJean-Sebastien Gelinas <calestar@gmail.com>
Tue, 28 Jul 2009 17:16:56 +0000 (13:16 -0400)
committerJean Privat <jean@pryen.org>
Thu, 30 Jul 2009 17:25:57 +0000 (13:25 -0400)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

tests/tests.sh

index 5b32a7d..78188fd 100755 (executable)
@@ -128,6 +128,10 @@ ok=""
 nok=""
 
 for ii in "$@"; do
+       if [ ! -f $ii ]; then
+               echo "File '$ii' does not exist."
+               continue
+       fi
        for alt in "" `sed -n 's/.*#!*\(alt[0-9]*\)#.*/\1/p' "$ii" | sort -u`; do
                f=`basename "$ii" .nit`
                d=`dirname "$ii"`