• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2015 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// Reusable Camera performance test classes and helpers
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20android_library {
21    name: "cts-camera-performance-tests",
22
23    static_libs: [
24        "compatibility-device-util-axt",
25        "ctstestrunner-axt",
26        "mockito-target-minus-junit4",
27        "CtsCameraUtils",
28        "truth-prebuilt",
29        "androidx.test.rules",
30    ],
31
32    manifest: "AndroidManifest-lib.xml",
33    resource_dirs: ["res"],
34    srcs: [
35        "src/android/hardware/camera2/cts/testcases/Camera2AndroidTestRule.java",
36        "src/android/hardware/camera2/cts/Camera2SurfaceViewCtsActivity.java",
37        "src/android/hardware/camera2/cts/testcases/Camera2SurfaceViewTestCase.java",
38        "src/android/hardware/camera2/cts/PerformanceTest.java",
39        "src/android/hardware/cts/CameraPerformanceTestHelper.java",
40        "src/android/hardware/cts/LegacyCameraPerformanceTest.java",
41        "src/android/hardware/camera2/cts/RecordingTest.java",
42    ],
43
44    sdk_version: "test_current",
45
46    libs: [
47        "android.test.runner.stubs",
48        "android.test.base.stubs",
49    ],
50}
51
52// CtsCameraTestCases package
53android_test {
54    name: "CtsCameraTestCases",
55    defaults: ["cts_defaults"],
56    // Include both the 32 and 64 bit versions
57    compile_multilib: "both",
58    static_libs: [
59        "compatibility-device-util-axt",
60        "ctstestrunner-axt",
61        "cts-hardware-lib",
62        "mockito-target-minus-junit4",
63        "android-ex-camera2",
64        "CtsCameraUtils",
65        "truth-prebuilt",
66        "androidx.heifwriter_heifwriter",
67        "androidx.test.rules",
68        "MediaPerformanceClassCommon",
69        "cts-wm-util",
70        "cts-install-lib",
71        "androidx.camera_camera-core",
72        "androidx.camera_camera-extensions",
73        "androidx.camera_camera-lifecycle",
74    ],
75    jni_libs: [
76        "libctscamera2_jni",
77        "libnativehelper_compat_libc++",
78    ],
79    stl: "c++_shared",
80    srcs: [
81        "src/**/*.java",
82        ":CtsCameraTestCases-rscript{CtsCameraTestCases.srcjar}",
83    ],
84    java_resources: [
85        ":CameraCtsPropertyTestApp1",
86        ":CameraCtsPropertyTestApp2",
87    ],
88    resource_zips: [
89        ":CtsCameraTestCases-rscript{CtsCameraTestCases.res.zip}",
90    ],
91    test_suites: [
92        "cts",
93        "general-tests",
94    ],
95    sdk_version: "test_current",
96    libs: [
97        "android.test.runner.stubs",
98        "android.test.base.stubs",
99    ],
100    per_testcase_directory: true,
101}
102
103genrule {
104    name: "CtsCameraTestCases-rscript",
105    srcs: [
106        "src/**/*.rscript",
107        ":rs_script_api",
108        ":rs_clang_headers",
109    ],
110    tools: [
111        "llvm-rs-cc",
112        "soong_zip",
113    ],
114    out: [
115        "CtsCameraTestCases.srcjar",
116        "CtsCameraTestCases.res.zip",
117    ],
118    cmd: "for f in $(locations src/**/*.rscript); do " +
119        "  $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
120        "  -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
121        "  -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
122        "done && " +
123        "$(location soong_zip) -srcjar -o $(location CtsCameraTestCases.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
124        "$(location soong_zip) -o $(location CtsCameraTestCases.res.zip) -C $(genDir)/res -D $(genDir)/res",
125}
126