Add a gtest build target for the host.

Change-Id: Ib888e143c7f3c110a0596ce37f51138a4da31b5a
http://b/4584343
diff --git a/Android.common.mk b/Android.common.mk
index 69ea22c..496dfa3 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -33,3 +33,7 @@
 LIBART_LOCAL_SRC_FILES += \
 	src/assembler_x86.cc
 endif
+
+TEST_LOCAL_SRC_FILES := \
+	src/assembler_x86_test.cc
+
diff --git a/Android.mk b/Android.mk
index a64104d..ebca28c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,5 +22,6 @@
 
 ifeq ($(WITH_HOST_DALVIK),true)
     include $(LOCAL_PATH)/Android.libart.host.mk
+    include $(LOCAL_PATH)/Android.test.host.mk
     include $(LOCAL_PATH)/Android.aexec.host.mk
 endif
diff --git a/Android.test.host.mk b/Android.test.host.mk
new file mode 100644
index 0000000..608fde1
--- /dev/null
+++ b/Android.test.host.mk
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+local_module_tags := eng tests
+
+include $(LOCAL_PATH)/Android.common.mk
+local_cpp_extension := $(LOCAL_CPP_EXTENSION)
+
+local_shared_libraries := \
+	libart
+
+local_c_includes := \
+	external/gtest/include \
+	$(LOCAL_PATH)/src
+
+local_whole_static_libraries := \
+	libgtest_host \
+	libgtest_main_host
+
+$(foreach file,$(TEST_LOCAL_SRC_FILES), \
+  $(eval include $(CLEAR_VARS)) \
+  $(eval LOCAL_CPP_EXTENSION := $(local_cpp_extension)) \
+  $(eval LOCAL_MODULE := $(notdir $(file:%.cc=%))) \
+  $(eval LOCAL_MODULE_TAGS := $(local_module_tags)) \
+  $(eval LOCAL_SRC_FILES := $(file)) \
+  $(eval LOCAL_C_INCLUDES := $(local_c_includes)) \
+  $(eval LOCAL_WHOLE_STATIC_LIBRARIES := $(local_whole_static_libraries)) \
+  $(eval LOCAL_SHARED_LIBRARIES := $(local_shared_libraries)) \
+  $(eval include $(BUILD_HOST_EXECUTABLE)) \
+)
diff --git a/src/assembler_x86.h b/src/assembler_x86.h
index c1c16c7..e2445c5 100644
--- a/src/assembler_x86.h
+++ b/src/assembler_x86.h
@@ -5,6 +5,7 @@
 
 #include <stdint.h>
 #include <string.h>
+#include "src/assembler.h"
 #include "src/constants_x86.h"
 #include "src/macros.h"
 #include "src/utils.h"
diff --git a/src/assembler_x86_test.cc b/src/assembler_x86_test.cc
new file mode 100644
index 0000000..3c2a02d
--- /dev/null
+++ b/src/assembler_x86_test.cc
@@ -0,0 +1,10 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Author: cshapiro@google.com (Carl Shapiro)
+#include "src/assembler_x86.h"
+
+#include <stdio.h>
+#include "gtest/gtest.h"
+
+TEST(AssemblerX86, Init) {
+  ASSERT_TRUE(true);
+}