Merge "Fixed run-tests.sh when only 64-bit host toolchains are present"
diff --git a/tests/run-tests-all.sh b/tests/run-tests-all.sh
index 9cea1e2..73d90ef 100755
--- a/tests/run-tests-all.sh
+++ b/tests/run-tests-all.sh
@@ -49,17 +49,26 @@
 case "$HOST_TAG" in
     linux-x86_64|darwin-x86_64)
         if [ -d "$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/$HOST_TAG" ] ; then
-            # ideally we should check each individual compiler the presence of 64-bit
-            # but for test script this is fine
-            TEST_HOST_32BIT=yes
-            TAGS=$TAGS" $HOST_TAG32"
+            if [ -d "$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/$HOST_TAG32" ] ; then
+                # ideally we should check each individual compiler the presence of 64-bit
+                # but for test script this is fine
+                TEST_HOST_32BIT=yes
+                TAGS=$TAGS" $HOST_TAG32"
+            fi
+        else
+            TAGS=$HOST_TAG32
         fi
     ;;
     windows*)
-        if [ "$ProgramW6432"!="" -a \
-             -d "$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64" ] ; then
-            TEST_HOST_32BIT=yes
-            TAGS=$TAGS" windows-x86_64"
+        if [ "$ProgramW6432"!="" -a ] ; then
+            if [ -d "$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64" ] ; then
+                if [ -d "$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows" ] ; then
+                    TEST_HOST_32BIT=yes
+                    TAGS=$TAGS" windows-x86_64"
+                fi
+            else
+                TAGS=windows
+            fi
         fi
 esac
 
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index 31f4d15..8a5d3e6 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -473,7 +473,7 @@
                 # only skip listed in file
                 TARGET_TOOLCHAIN=`get_build_var $PROJECT TARGET_TOOLCHAIN`
                 TARGET_TOOLCHAIN_VERSION=`echo $TARGET_TOOLCHAIN | tr '-' '\n' | tail -1`
-                grep -q -w -e "$TARGET_TOOLCHAIN_VERSION" "$PROJECT/BROKEN_BUILD"
+                grep -q -e "$TARGET_TOOLCHAIN_VERSION" "$PROJECT/BROKEN_BUILD"
                 if [ $? = 0 ] ; then
                     if [ -z "$ERRMSG" ] ; then
                         echo "Skipping `basename $PROJECT`: (no build for $TARGET_TOOLCHAIN_VERSION)"
@@ -685,7 +685,7 @@
                     # skip all tests built by toolchain
                     TARGET_TOOLCHAIN=`get_build_var $TEST TARGET_TOOLCHAIN`
                     TARGET_TOOLCHAIN_VERSION=`echo $TARGET_TOOLCHAIN | tr '-' '\n' | tail -1`
-                    grep -q -w -e "$TARGET_TOOLCHAIN_VERSION" "$TEST/BROKEN_RUN"
+                    grep -q -e "$TARGET_TOOLCHAIN_VERSION" "$TEST/BROKEN_RUN"
                     if [ $? = 0 ] ; then
                         dump "Skipping NDK device test run: $TEST_NAME (no run for binary built by $TARGET_TOOLCHAIN_VERSION)"
                         return 0