Ensure the ART binary is present on PATH.

In case we import a PATH that lack the APEX bin directory from the host
OS in the chroot test environment.

Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 \
        org.apache.harmony.tests.java.lang.Process2Test
  Check with an early exit in the script that it adds a path element if
  necessary.
Test: art/tools/run-libcore-tests.sh --mode=host --variant=X64 \
        org.apache.harmony.tests.java.lang.Process2Test
Bug: 210859761
Change-Id: I78d34c84b2e6290d48aff3c4c22f980a6e261174
diff --git a/tools/art b/tools/art
index 54cb7ac..e545fc3 100755
--- a/tools/art
+++ b/tools/art
@@ -520,6 +520,12 @@
   echo "Warning: Android Compiler not found as either $DEX2OAT_BINARY_TARGET_PATH or $DEX2OAT_BINARY_HOST_PATH"
 fi
 
+# Ensure the ART binary is present on PATH, in case we're in a chroot on a
+# sufficiently old device OS (b/210859761).
+if [[ ":$PATH:" != *:$ANDROID_ART_ROOT/bin:* ]]; then
+  export PATH="$PATH:$ANDROID_ART_ROOT/bin"
+fi
+
 ######################################
 # Main program
 ######################################