• 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    ],
71    jni_libs: [
72        "libctscamera2_jni",
73        "libnativehelper_compat_libc++",
74    ],
75    stl: "c++_shared",
76    srcs: [
77        "src/**/*.java",
78        ":CtsCameraTestCases-rscript{CtsCameraTestCases.srcjar}",
79    ],
80    resource_zips: [
81        ":CtsCameraTestCases-rscript{CtsCameraTestCases.res.zip}",
82    ],
83    test_suites: [
84        "cts",
85        "general-tests",
86    ],
87    sdk_version: "test_current",
88    libs: [
89        "android.test.runner.stubs",
90        "android.test.base.stubs",
91    ],
92    per_testcase_directory: true,
93}
94
95genrule {
96    name: "CtsCameraTestCases-rscript",
97    srcs: [
98        "src/**/*.rscript",
99        ":rs_script_api",
100        ":rs_clang_headers",
101    ],
102    tools: [
103        "llvm-rs-cc",
104        "soong_zip",
105    ],
106    out: [
107        "CtsCameraTestCases.srcjar",
108        "CtsCameraTestCases.res.zip",
109    ],
110    cmd: "for f in $(locations src/**/*.rscript); do " +
111        "  $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
112        "  -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
113        "  -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
114        "done && " +
115        "$(location soong_zip) -srcjar -o $(location CtsCameraTestCases.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
116        "$(location soong_zip) -o $(location CtsCameraTestCases.res.zip) -C $(genDir)/res -D $(genDir)/res",
117}
118