Use ART defaults for libnative{bridge,loader} tests too.

Should fix mac builds.

Test: m
Test: mmma art/libnativebridge/ art/libnativeloader/
Test: Forrest build on sdk_mac on git_master-without-vendor
Bug: 143111454
Bug: 137364733
Bug: 133140750
Change-Id: I424399115af3a9b558d4b95e2f614807d66dbd23
diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp
index 2bb8467..9211634 100644
--- a/libnativebridge/tests/Android.bp
+++ b/libnativebridge/tests/Android.bp
@@ -16,13 +16,22 @@
 
 cc_defaults {
     name: "libnativebridge-dummy-defaults",
-
-    host_supported: true,
-    cflags: [
-        "-Wall",
-        "-Wextra",
-        "-Werror",
+    defaults: [
+        "art_defaults",
+        "art_test_defaults",
     ],
+    // TODO(mast): Split up art_gtest_defaults so that it can be used for the
+    // following without pulling in lots of libs.
+    target: {
+        linux: {
+            cflags: [
+                // gtest issue
+                "-Wno-used-but-marked-unused",
+                "-Wno-deprecated",
+                "-Wno-missing-noreturn",
+            ],
+        },
+    },
     header_libs: ["libnativebridge-headers"],
     cppflags: ["-fvisibility=protected"],
 }
@@ -48,12 +57,23 @@
 // Build the unit tests.
 cc_defaults {
     name: "libnativebridge-tests-defaults",
-    test_per_src: true,
-
-    cflags: [
-        "-Wall",
-        "-Werror",
+    defaults: [
+        "art_defaults",
+        "art_test_defaults",
     ],
+    test_per_src: true,
+    // TODO(mast): Split up art_gtest_defaults so that it can be used for the
+    // following without pulling in lots of libs.
+    target: {
+        linux: {
+            cflags: [
+                // gtest issue
+                "-Wno-used-but-marked-unused",
+                "-Wno-deprecated",
+                "-Wno-missing-noreturn",
+            ],
+        },
+    },
 
     srcs: [
         "CodeCacheCreate_test.cpp",
@@ -88,21 +108,36 @@
 cc_test {
     name: "libnativebridge-tests",
     defaults: ["libnativebridge-tests-defaults"],
-    host_supported: true,
     shared_libs: ["libnativebridge"],
 }
 
 cc_test {
     name: "libnativebridge-lazy-tests",
     defaults: ["libnativebridge-tests-defaults"],
+    host_supported: false,
     shared_libs: ["libnativebridge_lazy"],
 }
 
 // Build the test for the C API.
 cc_test {
     name: "libnativebridge-api-tests",
-    host_supported: true,
+    defaults: [
+        "art_defaults",
+        "art_test_defaults",
+    ],
     test_per_src: true,
+    // TODO(mast): Split up art_gtest_defaults so that it can be used for the
+    // following without pulling in lots of libs.
+    target: {
+        linux: {
+            cflags: [
+                // gtest issue
+                "-Wno-used-but-marked-unused",
+                "-Wno-deprecated",
+                "-Wno-missing-noreturn",
+            ],
+        },
+    },
     srcs: [
         "NativeBridgeApi.c",
     ],