Fixes to allow test-art-host to run via build server

Change-Id: Ifc4259ab03cb3867b625c2e1edf4352398c8a8e8
diff --git a/test/run-test b/test/run-test
index c3943e7..ea60f51 100755
--- a/test/run-test
+++ b/test/run-test
@@ -170,6 +170,13 @@
     fi
 elif [ "$runtime" = "art" ]; then
     if [ "$target_mode" = "no" ]; then
+	# ANDROID_BUILD_TOP and ANDROID_HOST_OUT are not set in a build environment.
+        if [ -z "$ANDROID_BUILD_TOP" ]; then
+	    export ANDROID_BUILD_TOP=$oldwd
+        fi
+        if [ -z "$ANDROID_HOST_OUT" ]; then
+	    export ANDROID_HOST_OUT=$ANDROID_BUILD_TOP/out/host/linux-x86
+        fi
         run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core.art"
     else
         run_args="${run_args} --boot -Ximage:/data/art-test/core.art"