Do not emit color codes when running run-jdwp-tests.sh with no terminal

Tell Vogar to suppress color-related control characters if the script
output is not to a terminal. This is to ease reading logs produced by
the ART Buildbot.

Bug: 130709497
Test: art/tools/run-jdwp-tests.sh --mode host | tee /tmp/log.txt
Test: art/tools/run-jdwp-tests.sh --mode host
Change-Id: I98d62b67ac3cdb48e2657d204befc1e3b17db2d4
diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh
index 9f1d2a7..9ad9d66 100755
--- a/tools/run-jdwp-tests.sh
+++ b/tools/run-jdwp-tests.sh
@@ -245,6 +245,11 @@
   fi
 done
 
+if [ ! -t 1 ] ; then
+  # Suppress color codes if not attached to a terminal
+  args="$args --no-color"
+fi
+
 if [[ $mode == "target" ]]; then
   # Honor environment variable ART_TEST_CHROOT.
   if [[ -n "$ART_TEST_CHROOT" ]]; then