Finish dexlayout dumping of dex files and added test.

The test runs dexdump and dexlayout over the first core library jar file
and diffs the output, checking that they're the same. More dex files
will be added later for better coverage.

Bug: 29921113
Test: mm test-art-host-gtest-dexlayout_test
(cherry-picked from commit a378e88db648cf19e771714dd1059cf3d41d4753)

Change-Id: Idfd8ac9f069885b675a4a2f0c70aef2cbef5a9b8
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 9ec072f..08b56d0 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -126,6 +126,19 @@
   $(TARGET_CORE_IMAGE_default_no-pic_32) \
   dexdump2
 
+# The dexlayout test requires an image and the dexlayout utility.
+# TODO: rename into dexdump when migration completes
+ART_GTEST_dexlayout_test_HOST_DEPS := \
+  $(HOST_CORE_IMAGE_default_no-pic_64) \
+  $(HOST_CORE_IMAGE_default_no-pic_32) \
+  $(HOST_OUT_EXECUTABLES)/dexlayout \
+  $(HOST_OUT_EXECUTABLES)/dexdump2
+ART_GTEST_dexlayout_test_TARGET_DEPS := \
+  $(TARGET_CORE_IMAGE_default_no-pic_64) \
+  $(TARGET_CORE_IMAGE_default_no-pic_32) \
+  dexlayout \
+  dexdump2
+
 # The dexlist test requires an image and the dexlist utility.
 ART_GTEST_dexlist_test_HOST_DEPS := \
   $(HOST_CORE_IMAGE_default_no-pic_64) \
@@ -170,6 +183,7 @@
 RUNTIME_GTEST_COMMON_SRC_FILES := \
   cmdline/cmdline_parser_test.cc \
   dexdump/dexdump_test.cc \
+  dexlayout/dexlayout_test.cc \
   dexlist/dexlist_test.cc \
   dex2oat/dex2oat_test.cc \
   imgdiag/imgdiag_test.cc \