Run test run: Reduce verbosity
All commands are printed to terminal for failing tests.
Reduce the number of commands printed.
In particular, 'echo' which was used only for debugging.
Test: Observe terminal output for failing test
Change-Id: Ief4f95363e4463b1234b743ef623f25d49d6c3f1
diff --git a/test/default_run.py b/test/default_run.py
index b6d2451..3f1baf3 100755
--- a/test/default_run.py
+++ b/test/default_run.py
@@ -1146,8 +1146,7 @@
if not HOST:
adb.root()
adb.wait_for_device()
- adb.shell(f"rm -rf {CHROOT_DEX_LOCATION}")
- adb.shell(f"mkdir -p {CHROOT_DEX_LOCATION}")
+ adb.shell(f"rm -rf {CHROOT_DEX_LOCATION} && mkdir -p {CHROOT_DEX_LOCATION}")
adb.push(f"{TEST_NAME}*.jar", CHROOT_DEX_LOCATION)
if PROFILE or RANDOM_PROFILE:
adb.push("profile", CHROOT_DEX_LOCATION, check=False)
@@ -1260,15 +1259,13 @@
cmdfile.flush()
adb.push(
cmdfile.name, f"{CHROOT_DEX_LOCATION}/cmdline.sh", save_cmd=False)
- run('echo cmdline.sh "' + cmdline.replace('"', '\\"') + '"')
chroot_prefix = f"chroot {CHROOT}" if CHROOT else ""
return adb.shell(f"{chroot_prefix} sh {DEX_LOCATION}/cmdline.sh", **kwargs)
if USE_GDB or USE_GDBSERVER:
print(f"Forward {GDBSERVER_PORT} to local port and connect GDB")
- run_cmd(f"rm -rf {DEX_LOCATION}/dalvik-cache/")
- run_cmd(f"mkdir -p {mkdir_locations}")
+ run_cmd(f"rm -rf {DEX_LOCATION}/dalvik-cache/ && mkdir -p {mkdir_locations}")
# Restore stdout/stderr from previous run (the directory might have been cleared).
adb.push(args.stdout_file, f"{CHROOT}{DEX_LOCATION}/{basename(args.stdout_file)}")
adb.push(args.stderr_file, f"{CHROOT}{DEX_LOCATION}/{basename(args.stderr_file)}")
diff --git a/test/run-test b/test/run-test
index bb16938..612aa92 100755
--- a/test/run-test
+++ b/test/run-test
@@ -24,9 +24,10 @@
from shutil import copyfile
from typing import Optional
-COLOR_RED = '\033[91m'
+COLOR_BLUE = '\033[94m'
COLOR_GREEN = '\033[92m'
COLOR_NORMAL = '\033[0m'
+COLOR_RED = '\033[91m'
# Helper class which allows us to access the environment using syntax sugar.
# E.g. `env.ANDROID_BUILD_TOP` instead of `os.environ["ANDROID_BUILD_TOP"]`.
@@ -93,7 +94,7 @@
encoding="utf8",
capture_output=capture_output)
if (check and proc.returncode != 0) or (quiet == "no"):
- print("$ " + cmdline)
+ print(f"{COLOR_BLUE}$ {cmdline}{COLOR_NORMAL}")
print(proc.stdout or "", file=sys.stdout, end="", flush=True)
print(COLOR_RED + (proc.stderr or "") + COLOR_NORMAL, file=sys.stderr, end="", flush=True)
if (check and proc.returncode != 0):