• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2008 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: [
20        "Android-Apache-2.0",
21    ],
22}
23
24android_test {
25    name: "RSTest",
26    static_libs: ["androidx.test.rules"],
27    srcs: [
28        "src/**/*.java",
29        ":RSUnitTests_java_srcs",
30        ":RSUnitTests_java_gui",
31        ":RSTest-rscript{RSTest.srcjar}",
32    ],
33    resource_zips: [
34        ":RSTest-rscript{RSTest.res.zip}",
35    ],
36    sdk_version: "current",
37    test_suites: ["device-tests"],
38}
39
40genrule {
41    name: "RSTest-rscript",
42    srcs: [
43        ":RSUnitTests_rscript_srcs",
44        ":rs_script_api",
45        ":rs_clang_headers",
46    ],
47    tools: [
48        "llvm-rs-cc",
49        "soong_zip",
50    ],
51    out: [
52        "RSTest.srcjar",
53        "RSTest.res.zip",
54    ],
55    cmd: "for f in $(locations :RSUnitTests_rscript_srcs); do " +
56        "  $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
57        "  -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
58        "  -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
59        "done && " +
60        "$(location soong_zip) -srcjar -o $(location RSTest.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
61        "$(location soong_zip) -o $(location RSTest.res.zip) -C $(genDir)/res -D $(genDir)/res",
62}
63