Add test for importing a single type.
Test: `cd system/tools/hidl && mma`
Bug: 31821285
Change-Id: I0be97b16b84f76b64c09f9dc52709416601cbbdf
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 4896fc3..1fbb7bd 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -8,11 +8,15 @@
"types.hal",
"IFoo.hal",
"IFooCallback.hal",
+ "IMyTypes.hal",
+ "ITheirTypes.hal",
],
out: [
"android/hardware/tests/foo/1.0/types.cpp",
"android/hardware/tests/foo/1.0/FooAll.cpp",
"android/hardware/tests/foo/1.0/FooCallbackAll.cpp",
+ "android/hardware/tests/foo/1.0/MyTypesAll.cpp",
+ "android/hardware/tests/foo/1.0/TheirTypesAll.cpp",
],
}
@@ -24,6 +28,8 @@
"types.hal",
"IFoo.hal",
"IFooCallback.hal",
+ "IMyTypes.hal",
+ "ITheirTypes.hal",
],
out: [
"android/hardware/tests/foo/1.0/types.h",
@@ -37,6 +43,16 @@
"android/hardware/tests/foo/1.0/BnFooCallback.h",
"android/hardware/tests/foo/1.0/BpFooCallback.h",
"android/hardware/tests/foo/1.0/BsFooCallback.h",
+ "android/hardware/tests/foo/1.0/IMyTypes.h",
+ "android/hardware/tests/foo/1.0/IHwMyTypes.h",
+ "android/hardware/tests/foo/1.0/BnMyTypes.h",
+ "android/hardware/tests/foo/1.0/BpMyTypes.h",
+ "android/hardware/tests/foo/1.0/BsMyTypes.h",
+ "android/hardware/tests/foo/1.0/ITheirTypes.h",
+ "android/hardware/tests/foo/1.0/IHwTheirTypes.h",
+ "android/hardware/tests/foo/1.0/BnTheirTypes.h",
+ "android/hardware/tests/foo/1.0/BpTheirTypes.h",
+ "android/hardware/tests/foo/1.0/BsTheirTypes.h",
],
}
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index c1c2c6b..3d82353 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -17,6 +17,8 @@
package android.hardware.tests.foo@1.0;
import IFooCallback;
+import IMyTypes.SomeStruct;
+import ITheirTypes.FloatArray;
interface IFoo {
@@ -72,6 +74,11 @@
ThreeStrings[5] s;
};
+ struct MyStruct {
+ SomeStruct innerStruct;
+ FloatArray myFloatArray;
+ };
+
doThis(float param);
doThatAndReturnSomething(int64_t param) generates (int32_t result);
doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
diff --git a/tests/foo/1.0/IMyTypes.hal b/tests/foo/1.0/IMyTypes.hal
new file mode 100644
index 0000000..c8469a8
--- /dev/null
+++ b/tests/foo/1.0/IMyTypes.hal
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+package android.hardware.tests.foo@1.0;
+
+
+interface IMyTypes {
+ struct SomeStruct {
+ };
+ typedef float[30] FloatArray;
+};
diff --git a/tests/foo/1.0/ITheirTypes.hal b/tests/foo/1.0/ITheirTypes.hal
new file mode 100644
index 0000000..7b955e0
--- /dev/null
+++ b/tests/foo/1.0/ITheirTypes.hal
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+package android.hardware.tests.foo@1.0;
+
+
+interface ITheirTypes {
+ struct SomeStruct {
+ };
+ typedef float[10] FloatArray;
+};
diff --git a/tests/foo/1.0/types.hal b/tests/foo/1.0/types.hal
index 9666b53..a01fc2d 100644
--- a/tests/foo/1.0/types.hal
+++ b/tests/foo/1.0/types.hal
@@ -24,6 +24,9 @@
struct Outer {
struct Inner {
+ struct Deep {
+ int32_t data;
+ };
int32_t data;
};
};