summaryrefslogtreecommitdiff
path: root/tests/camera/Android.bp
blob: c2334fc3b4c5fc31f99db06b54899129c5e97d06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright (C) 2015 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.

// Reusable Camera performance test classes and helpers
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

android_library {
    name: "cts-camera-performance-tests",

    static_libs: [
        "compatibility-device-util-axt",
        "ctstestrunner-axt",
        "mockito-target-minus-junit4",
        "CtsCameraUtils",
        "truth-prebuilt",
        "androidx.test.rules",
    ],

    manifest: "AndroidManifest-lib.xml",
    resource_dirs: ["res"],
    srcs: [
        "src/android/hardware/camera2/cts/testcases/Camera2AndroidTestRule.java",
        "src/android/hardware/camera2/cts/Camera2SurfaceViewCtsActivity.java",
        "src/android/hardware/camera2/cts/testcases/Camera2SurfaceViewTestCase.java",
        "src/android/hardware/camera2/cts/PerformanceTest.java",
        "src/android/hardware/cts/CameraPerformanceTestHelper.java",
        "src/android/hardware/cts/LegacyCameraPerformanceTest.java",
        "src/android/hardware/camera2/cts/RecordingTest.java",
    ],

    sdk_version: "test_current",

    libs: [
        "android.test.runner.stubs",
        "android.test.base.stubs",
    ],
}

// CtsCameraTestCases package
android_test {
    name: "CtsCameraTestCases",
    defaults: ["cts_defaults"],
    // Include both the 32 and 64 bit versions
    compile_multilib: "both",
    static_libs: [
        "compatibility-device-util-axt",
        "ctstestrunner-axt",
        "cts-hardware-lib",
        "mockito-target-minus-junit4",
        "android-ex-camera2",
        "CtsCameraUtils",
        "truth-prebuilt",
        "androidx.heifwriter_heifwriter",
        "androidx.test.rules",
        "MediaPerformanceClassCommon",
    ],
    jni_libs: [
        "libctscamera2_jni",
        "libnativehelper_compat_libc++",
    ],
    stl: "c++_shared",
    srcs: [
        "src/**/*.java",
        ":CtsCameraTestCases-rscript{CtsCameraTestCases.srcjar}",
    ],
    resource_zips: [
        ":CtsCameraTestCases-rscript{CtsCameraTestCases.res.zip}",
    ],
    test_suites: [
        "cts",
        "general-tests",
    ],
    sdk_version: "test_current",
    libs: [
        "android.test.runner.stubs",
        "android.test.base.stubs",
    ],
    per_testcase_directory: true,
}

genrule {
    name: "CtsCameraTestCases-rscript",
    srcs: [
        "src/**/*.rscript",
        ":rs_script_api",
        ":rs_clang_headers",
    ],
    tools: [
        "llvm-rs-cc",
        "soong_zip",
    ],
    out: [
        "CtsCameraTestCases.srcjar",
        "CtsCameraTestCases.res.zip",
    ],
    cmd: "for f in $(locations src/**/*.rscript); do " +
        "  $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
        "  -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
        "  -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
        "done && " +
        "$(location soong_zip) -srcjar -o $(location CtsCameraTestCases.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
        "$(location soong_zip) -o $(location CtsCameraTestCases.res.zip) -C $(genDir)/res -D $(genDir)/res",
}