mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Add test for importing a single type." am: a543fe6ab0 am: ccdc46999a
am: 91c349e395
Change-Id: Ic90328c30bd9d4c2c020e4d1243aacc7ae4ff550
This commit is contained in:
@@ -6,9 +6,11 @@ genrule {
|
|||||||
cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.bar@1.0",
|
cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.bar@1.0",
|
||||||
srcs: [
|
srcs: [
|
||||||
"IBar.hal",
|
"IBar.hal",
|
||||||
|
"IImportTypes.hal",
|
||||||
],
|
],
|
||||||
out: [
|
out: [
|
||||||
"android/hardware/tests/bar/1.0/BarAll.cpp",
|
"android/hardware/tests/bar/1.0/BarAll.cpp",
|
||||||
|
"android/hardware/tests/bar/1.0/ImportTypesAll.cpp",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,6 +20,7 @@ genrule {
|
|||||||
cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.bar@1.0",
|
cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tests.bar@1.0",
|
||||||
srcs: [
|
srcs: [
|
||||||
"IBar.hal",
|
"IBar.hal",
|
||||||
|
"IImportTypes.hal",
|
||||||
],
|
],
|
||||||
out: [
|
out: [
|
||||||
"android/hardware/tests/bar/1.0/IBar.h",
|
"android/hardware/tests/bar/1.0/IBar.h",
|
||||||
@@ -25,6 +28,11 @@ genrule {
|
|||||||
"android/hardware/tests/bar/1.0/BnBar.h",
|
"android/hardware/tests/bar/1.0/BnBar.h",
|
||||||
"android/hardware/tests/bar/1.0/BpBar.h",
|
"android/hardware/tests/bar/1.0/BpBar.h",
|
||||||
"android/hardware/tests/bar/1.0/BsBar.h",
|
"android/hardware/tests/bar/1.0/BsBar.h",
|
||||||
|
"android/hardware/tests/bar/1.0/IImportTypes.h",
|
||||||
|
"android/hardware/tests/bar/1.0/IHwImportTypes.h",
|
||||||
|
"android/hardware/tests/bar/1.0/BnImportTypes.h",
|
||||||
|
"android/hardware/tests/bar/1.0/BpImportTypes.h",
|
||||||
|
"android/hardware/tests/bar/1.0/BsImportTypes.h",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,16 @@
|
|||||||
package android.hardware.tests.bar@1.0;
|
package android.hardware.tests.bar@1.0;
|
||||||
|
|
||||||
import android.hardware.tests.foo@1.0::IFoo;
|
import android.hardware.tests.foo@1.0::IFoo;
|
||||||
|
import android.hardware.tests.foo@1.0::Unrelated;
|
||||||
|
|
||||||
interface IBar extends android.hardware.tests.foo@1.0::IFoo {
|
interface IBar extends android.hardware.tests.foo@1.0::IFoo {
|
||||||
|
|
||||||
typedef android.hardware.tests.foo@1.0::IFoo FunkyAlias;
|
typedef android.hardware.tests.foo@1.0::IFoo FunkyAlias;
|
||||||
|
typedef Unrelated Related;
|
||||||
|
|
||||||
|
struct SomethingRelated {
|
||||||
|
Related myRelated;
|
||||||
|
};
|
||||||
|
|
||||||
thisIsNew();
|
thisIsNew();
|
||||||
};
|
};
|
||||||
|
|||||||
28
tests/bar/1.0/IImportTypes.hal
Normal file
28
tests/bar/1.0/IImportTypes.hal
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* 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.bar@1.0;
|
||||||
|
|
||||||
|
import android.hardware.tests.foo@1.0::types;
|
||||||
|
|
||||||
|
interface IImportTypes {
|
||||||
|
typedef Unrelated Related;
|
||||||
|
struct GoodStruct {
|
||||||
|
Outer outer;
|
||||||
|
android.hardware.tests.foo@1.0::Outer.Inner inner;
|
||||||
|
@1.0::Outer.Inner.Deep deep;
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -8,11 +8,15 @@ genrule {
|
|||||||
"types.hal",
|
"types.hal",
|
||||||
"IFoo.hal",
|
"IFoo.hal",
|
||||||
"IFooCallback.hal",
|
"IFooCallback.hal",
|
||||||
|
"IMyTypes.hal",
|
||||||
|
"ITheirTypes.hal",
|
||||||
],
|
],
|
||||||
out: [
|
out: [
|
||||||
"android/hardware/tests/foo/1.0/types.cpp",
|
"android/hardware/tests/foo/1.0/types.cpp",
|
||||||
"android/hardware/tests/foo/1.0/FooAll.cpp",
|
"android/hardware/tests/foo/1.0/FooAll.cpp",
|
||||||
"android/hardware/tests/foo/1.0/FooCallbackAll.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 @@ genrule {
|
|||||||
"types.hal",
|
"types.hal",
|
||||||
"IFoo.hal",
|
"IFoo.hal",
|
||||||
"IFooCallback.hal",
|
"IFooCallback.hal",
|
||||||
|
"IMyTypes.hal",
|
||||||
|
"ITheirTypes.hal",
|
||||||
],
|
],
|
||||||
out: [
|
out: [
|
||||||
"android/hardware/tests/foo/1.0/types.h",
|
"android/hardware/tests/foo/1.0/types.h",
|
||||||
@@ -37,6 +43,16 @@ genrule {
|
|||||||
"android/hardware/tests/foo/1.0/BnFooCallback.h",
|
"android/hardware/tests/foo/1.0/BnFooCallback.h",
|
||||||
"android/hardware/tests/foo/1.0/BpFooCallback.h",
|
"android/hardware/tests/foo/1.0/BpFooCallback.h",
|
||||||
"android/hardware/tests/foo/1.0/BsFooCallback.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",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
package android.hardware.tests.foo@1.0;
|
package android.hardware.tests.foo@1.0;
|
||||||
|
|
||||||
import IFooCallback;
|
import IFooCallback;
|
||||||
|
import IMyTypes.SomeStruct;
|
||||||
|
import ITheirTypes.FloatArray;
|
||||||
|
|
||||||
interface IFoo {
|
interface IFoo {
|
||||||
|
|
||||||
@@ -72,6 +74,11 @@ interface IFoo {
|
|||||||
ThreeStrings[5] s;
|
ThreeStrings[5] s;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct MyStruct {
|
||||||
|
SomeStruct innerStruct;
|
||||||
|
FloatArray myFloatArray;
|
||||||
|
};
|
||||||
|
|
||||||
doThis(float param);
|
doThis(float param);
|
||||||
doThatAndReturnSomething(int64_t param) generates (int32_t result);
|
doThatAndReturnSomething(int64_t param) generates (int32_t result);
|
||||||
doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
|
doQuiteABit(int32_t a, int64_t b, float c, double d) generates (double something);
|
||||||
|
|||||||
24
tests/foo/1.0/IMyTypes.hal
Normal file
24
tests/foo/1.0/IMyTypes.hal
Normal file
@@ -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;
|
||||||
|
};
|
||||||
24
tests/foo/1.0/ITheirTypes.hal
Normal file
24
tests/foo/1.0/ITheirTypes.hal
Normal file
@@ -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;
|
||||||
|
};
|
||||||
@@ -24,6 +24,9 @@ struct Abc {
|
|||||||
|
|
||||||
struct Outer {
|
struct Outer {
|
||||||
struct Inner {
|
struct Inner {
|
||||||
|
struct Deep {
|
||||||
|
int32_t data;
|
||||||
|
};
|
||||||
int32_t data;
|
int32_t data;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user