1// Copyright (C) 2019 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// This is a cc_test just because it supports test_suites. This should be converted to something
16// like cc_binary_test_helper once supported, thus auto_gen_config:false below.
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "frameworks_base_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["frameworks_base_license"],
24}
25
26cc_test {
27    // Depending on how the test runs, the executable may be uploaded to different location.
28    // Before the bug in the file pusher is fixed, workaround by making the name unique.
29    // See b/124718249#comment12.
30    name: "block_device_writer_module",
31    stem: "block_device_writer",
32
33    srcs: ["block_device_writer.cpp"],
34    cflags: [
35        "-D_FILE_OFFSET_BITS=64",
36        "-Wall",
37        "-Werror",
38        "-Wextra",
39        "-g",
40    ],
41    shared_libs: ["libbase", "libutils"],
42    // For some reasons, cuttlefish (x86) uses x86_64 test suites for testing. Unfortunately, when
43    // the uploader does not pick up the executable from correct output location. The following
44    // workaround allows the test to:
45    //  * upload the 32-bit exectuable for both 32 and 64 bits devices to use
46    //  * refer to the same executable name in Java
47    //  * no need to force the Java test to be archiecture specific.
48    //
49    // See b/145573317 for details.
50    multilib: {
51        lib32: {
52            suffix: "",
53        },
54        lib64: {
55            suffix: "64",  // not really used
56        },
57    },
58
59    auto_gen_config: false,
60    test_suites: ["general-tests", "pts", "vts"],
61    gtest: false,
62}
63
64java_library_host {
65    name: "block_device_writer_jar",
66    srcs: ["src/**/*.java"],
67    libs: ["tradefed", "junit"],
68}
69