Use to-upper function instead of $(shell tr)

Calling $(shell tr) ~300 times to convert host to HOST and target to
TARGET was taking 600ms.  Use the to-upper function from
build/make/core/definitions.mk instead.

Bug: 26275726
Test: no change to out/build-hikey960-test-art.ninja
Change-Id: I591a95a5b8348240e1b02f14f302a4835910ec72
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 2df0cc6..464449c 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -32,11 +32,6 @@
   $(HOST_OUT_EXECUTABLES)/d8-compat-dx
 endif
 
-# Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE
-define name-to-var
-$(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
-endef  # name-to-var
-
 # We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
 # only once).
 TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
@@ -124,13 +119,13 @@
     endif
   endif
   ifeq ($(2),no-image)
-    $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
+    $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
   else
     ifeq ($(2),picimage)
-      $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
+      $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
     else
       ifeq ($(2),multipicimage)
-        $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4))
+        $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4))
       endif
     endif
   endif
@@ -174,7 +169,6 @@
 host_prereq_rules :=
 target_prereq_rules :=
 core-image-dependencies :=
-name-to-var :=
 define-test-art-host-or-target-run-test-group :=
 TARGET_TYPES :=
 COMPILER_TYPES :=