xref: /aosp_15_r20/cts/tests/sensor/Android.bp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//
16// Reusable Sensor test classes and helpers
17//
18package {
19    default_team: "trendy_team_android_sensors",
20    default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
23java_library {
24    name: "cts-sensors-tests",
25    defaults: ["cts_error_prone_rules_tests"],
26
27    static_libs: [
28        "compatibility-device-util-axt",
29        "cts-input-lib",
30    ],
31
32    libs: [
33        "platform-test-annotations",
34        "android.test.base.stubs",
35    ],
36
37    sdk_version: "test_current",
38
39    srcs: [
40        "src/**/*.java",
41        "src/**/*.kt",
42    ],
43    exclude_srcs: [
44        // Depends on resources, so can't be included in a java_library - we add
45        // this file explicitly to CtsSensorTestCases, which is the only place
46        // it's actually needed
47        "src/android/hardware/cts/SensorHeadTrackerTest.java",
48    ],
49}
50
51//
52// JNI components for testing NDK
53//
54cc_library_shared {
55    name: "libcts-sensors-ndk-jni",
56
57    cflags: [
58        "-Werror",
59        "-Wall",
60        "-Wextra",
61    ],
62
63    srcs: [
64        "jni/SensorTest.cpp",
65        "jni/SensorTestCases.cpp",
66        "jni/android_hardware_cts_SensorDirectReportTest.cpp",
67        "jni/android_hardware_cts_SensorNativeTest.cpp",
68        "jni/nativeTestHelper.cpp",
69    ],
70
71    header_libs: ["jni_headers"],
72
73    shared_libs: [
74        "libandroid",
75        "liblog",
76    ],
77
78    sdk_version: "current",
79
80    stl: "c++_shared",
81}
82
83//
84// CtsSensorTestCases package
85//
86android_test {
87    name: "CtsSensorTestCases",
88    defaults: [
89        "cts_defaults",
90    ],
91
92    // Tag this module as a cts test artifact
93    test_suites: [
94        "cts",
95        "general-tests",
96    ],
97
98    // include both the 32 and 64 bit versions
99    compile_multilib: "both",
100
101    static_libs: [
102        "compatibility-device-util-axt",
103        "ctstestrunner-axt",
104        "cts-sensors-tests",
105    ],
106
107    flags_packages: [
108        "android.permission.flags-aconfig",
109    ],
110
111    jni_libs: ["libcts-sensors-ndk-jni"],
112
113    sdk_version: "test_current",
114
115    libs: [
116        "android.test.runner.stubs",
117        "android.test.base.stubs",
118    ],
119
120    srcs: [
121        "src/android/hardware/cts/SensorHeadTrackerTest.java",
122    ],
123
124    stl: "c++_shared",
125}
126