Merge "Update build.gradle to match new DSL." into idea133
diff --git a/android-configure.sh b/android-configure.sh
index eb2a3e6..fb8ac47 100755
--- a/android-configure.sh
+++ b/android-configure.sh
@@ -72,6 +72,9 @@
   ;;
   --no-pcbios) PCBIOS_PROBE=no
   ;;
+  --no-tests)
+  # Ignore this option, only used by android-rebuild.sh
+  ;;
   *)
     echo "unknown option '$opt', use --help"
     exit 1
@@ -103,6 +106,7 @@
     echo "  --gles-dir=PATH          specify path to GLES host emulation sources [auto-detected]"
     echo "  --no-gles                disable GLES emulation support"
     echo "  --no-pcbios              disable copying of PC Bios files"
+    echo "  --no-tests               don't run unit test suite"
     echo ""
     exit 1
 fi
diff --git a/android-rebuild.sh b/android-rebuild.sh
index a4d09de..8b54f09 100755
--- a/android-rebuild.sh
+++ b/android-rebuild.sh
@@ -13,6 +13,7 @@
 VERBOSE=0
 
 MINGW=
+NO_TESTS=
 OUT_DIR=objs
 
 for OPT; do
@@ -23,6 +24,9 @@
         --verbose)
             VERBOSE=$(( $VERBOSE + 1 ))
             ;;
+        --no-tests)
+            NO_TESTS=true
+            ;;
         --out-dir=*)
             OUT_DIR=${OPT##--out-dir=}
             ;;
@@ -79,25 +83,36 @@
   RUN_64BIT_TESTS=
   TEST_SHELL=wine
   EXE_SUFFIX=.exe
+
+  # Check for Wine on this machine.
+  WINE_CMD=$(which $TEST_SHELL 2>/dev/null || true)
+  if [ -z "$NO_TESTS" -a -z "$WINE_CMD" ]; then
+    echo "WARNING: Wine is not installed on this machine!! Unit tests will be ignored!!"
+    NO_TESTS=true
+  fi
 fi
 
-echo "Running 32-bit unit test suite."
-FAILURES=""
-for UNIT_TEST in emulator_unittests emugl_common_host_unittests; do
-  echo "   - $UNIT_TEST"
-  run $TEST_SHELL $OUT_DIR/$UNIT_TEST$EXE_SUFFIX || FAILURES="$FAILURES $UNIT_TEST"
-done
-
-if [ "$RUN_64BIT_TESTS" ]; then
-    echo "Running 64-bit unit test suite."
-    for UNIT_TEST in emulator64_unittests emugl64_common_host_unittests; do
-        echo "   - $UNIT_TEST"
-        run $TEST_SHELL $OUT_DIR/$UNIT_TEST$EXE_SUFFIX || FAILURES="$FAILURES $UNIT_TEST"
+if [ -z "$NO_TESTS" ]; then
+    echo "Running 32-bit unit test suite."
+    FAILURES=""
+    for UNIT_TEST in emulator_unittests emugl_common_host_unittests; do
+    echo "   - $UNIT_TEST"
+    run $TEST_SHELL $OUT_DIR/$UNIT_TEST$EXE_SUFFIX || FAILURES="$FAILURES $UNIT_TEST"
     done
-fi
 
-if [ "$FAILURES" ]; then
-    panic "Unit test failures: $FAILURES"
+    if [ "$RUN_64BIT_TESTS" ]; then
+        echo "Running 64-bit unit test suite."
+        for UNIT_TEST in emulator64_unittests emugl64_common_host_unittests; do
+            echo "   - $UNIT_TEST"
+            run $TEST_SHELL $OUT_DIR/$UNIT_TEST$EXE_SUFFIX || FAILURES="$FAILURES $UNIT_TEST"
+        done
+    fi
+
+    if [ "$FAILURES" ]; then
+        panic "Unit test failures: $FAILURES"
+    fi
+else
+    echo "Ignoring unit tests suite."
 fi
 
 echo "Done. !!"