Enable tests

Test: atest
x86_64 grpcio-compiler_host_test_src_lib: Passed: 2, Failed: 0, Ignored: 0, Assumption Failed: 0,

Change-Id: Ica601e81f80f96345c17773b32ce445ba91baec2
diff --git a/Android.bp b/Android.bp
index 317b655..678c541 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --run --dependencies.
+// This file is generated by cargo2android.py --config cargo2android.json.
 // Do not modify this file as changes will be overridden on upgrade.
 
 package {
@@ -36,6 +36,8 @@
 rust_binary_host {
     name: "grpc_rust_plugin",
     crate_name: "grpc_rust_plugin",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.9.0",
     srcs: ["src/bin/grpc_rust_plugin.rs"],
     edition: "2018",
     features: [
@@ -49,10 +51,40 @@
     ],
 }
 
-rust_library_host {
-    name: "libgrpcio_compiler",
+rust_test_host {
+    name: "grpcio-compiler_host_test_src_bin_grpc_rust_plugin",
+    crate_name: "grpc_rust_plugin",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.9.0",
+    srcs: ["src/bin/grpc_rust_plugin.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2018",
+    features: [
+        "default",
+        "protobuf",
+        "protobuf-codec",
+    ],
+    rustlibs: [
+        "libgrpcio_compiler",
+        "libprotobuf",
+    ],
+}
+
+rust_test_host {
+    name: "grpcio-compiler_host_test_src_lib",
     crate_name: "grpcio_compiler",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.9.0",
     srcs: ["src/lib.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
     edition: "2018",
     features: [
         "default",
@@ -64,5 +96,19 @@
     ],
 }
 
-// dependent_library ["feature_list"]
-//   protobuf-2.24.1
+rust_library_host {
+    name: "libgrpcio_compiler",
+    crate_name: "grpcio_compiler",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.9.0",
+    srcs: ["src/lib.rs"],
+    edition: "2018",
+    features: [
+        "default",
+        "protobuf",
+        "protobuf-codec",
+    ],
+    rustlibs: [
+        "libprotobuf",
+    ],
+}
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..b7093f4
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,5 @@
+{
+  "dependencies": true,
+  "run": true,
+  "tests": true
+}