Fix missing entry for the static libdexfile_support test in the gtest list.

Also comment on the lack of test_per_src for those tests, and update the
find predicate in run-gtests.sh to handle these test binaries that end with
_tests instead of _test.

Bug: 123186083
Test: m test-art-host-gtest-art_libdexfile_support_tests
Test: m test-art-host-gtest-art_libdexfile_support_static_tests
Test: Buildbot style device test:
  art/tools/buildbot-build.sh -j8 --target && \
  art/tools/cleanup-buildbot-device.sh && \
  art/tools/setup-buildbot-device.sh && \
  art/tools/buildbot-sync.sh && \
  art/tools/run-gtests.sh
Change-Id: I2c103f760dde1154f44b1c90ff3ab9ae356d6318
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 21eee7a..a2a4312 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -387,6 +387,7 @@
     art_libartbase_tests \
     art_libartpalette_tests \
     art_libdexfile_external_tests \
+    art_libdexfile_support_static_tests \
     art_libdexfile_support_tests \
     art_libdexfile_tests \
     art_libprofile_tests \
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index 2289a9c..0a66557 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -275,6 +275,9 @@
     },
 }
 
+// The same source file is used in two tests here, so unlike other ART gtests it
+// doesn't use test_per_src. Its test target is
+// test-art-{host,target}-gtest-art_libdexfile_support_tests.
 art_cc_test {
     name: "art_libdexfile_support_tests",
     host_supported: true,
@@ -310,6 +313,9 @@
     export_header_lib_headers: ["libdexfile_external_headers"],
 }
 
+// The same source file is used in two tests here, so unlike other ART gtests it
+// doesn't use test_per_src. Its test target is
+// test-art-{host,target}-gtest-art_libdexfile_support_static_tests.
 art_cc_test {
     name: "art_libdexfile_support_static_tests",
     host_supported: true,
diff --git a/tools/run-gtests.sh b/tools/run-gtests.sh
index 8585589..602eac3 100755
--- a/tools/run-gtests.sh
+++ b/tools/run-gtests.sh
@@ -21,7 +21,8 @@
 failing_tests=()
 
 function add_tests {
-  all_tests+=$(${ADB} shell "test -d $ART_TEST_CHROOT/$1 && chroot $ART_TEST_CHROOT find $1 -name \*_test")
+  # Search for *_test and *_tests executables, but skip e.g. libfoo_test.so.
+  all_tests+=$(${ADB} shell "test -d $ART_TEST_CHROOT/$1 && chroot $ART_TEST_CHROOT find $1 -type f -perm /ugo+x -name \*_test\* \! -name \*.so")
 }
 
 function fail {
@@ -32,6 +33,7 @@
 add_tests "/data/nativetest64"
 
 for i in $all_tests; do
+  echo $i
   ${ADB} shell "chroot $ART_TEST_CHROOT env LD_LIBRARY_PATH= ANDROID_ROOT='/system' ANDROID_RUNTIME_ROOT=/system $i" || fail $i
 done