runtests: hardfail when a requested version is not found
authorMike Frysinger <vapier@gentoo.org>
Sun, 5 Jan 2014 15:33:41 +0000 (10:33 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 5 Jan 2014 19:08:58 +0000 (14:08 -0500)
This way people don't have to worry about runtests.sh passing for a
specific version when it wasn't found in the system.

runtests.sh

index 3006be55e3799db0fa39a28e81acda38fa010345..2870907a7d7ed3e31099708327f19608df8ec6e4 100755 (executable)
@@ -30,15 +30,18 @@ interrupted() {
 trap interrupted SIGINT
 
 unused_args=()
+IGNORE_MISSING_VERSIONS=true
 
 while [ $# -gt 0 ] ; do
        case "$1" in
                --python-versions=*)
                        PYTHON_VERSIONS=${1#--python-versions=}
+                       IGNORE_MISSING_VERSIONS=false
                        ;;
                --python-versions)
                        shift
                        PYTHON_VERSIONS=$1
+                       IGNORE_MISSING_VERSIONS=false
                        ;;
                *)
                        unused_args[${#unused_args[@]}]=$1
@@ -73,6 +76,9 @@ for version in ${PYTHON_VERSIONS}; do
                        exit_status="1"
                fi
                echo
+       elif [[ ${IGNORE_MISSING_VERSIONS} != "true" ]] ; then
+               echo -e "${BAD}Could not find requested Python ${version}${NORMAL}"
+               exit_status="1"
        fi
 done