1/*
2 * Copyright (C) 2014 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    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "libberberis_ndk_tests_defaults",
23    sdk_version: "current",
24    cflags: [
25        "-fexceptions",
26        "-Wunused",
27        "-Wextra",
28        "-Wall",
29        "-Werror",
30        "-Wno-deprecated-declarations",
31    ],
32    stl: "libc++_static",
33}
34
35cc_library_shared {
36    name: "libberberis_ndk_tests_shared_lib",
37    defaults: ["libberberis_ndk_tests_defaults"],
38    srcs: ["jni/shared_lib.cc"],
39}
40
41cc_library_shared {
42    name: "libberberis_ndk_tests",
43    defaults: ["libberberis_ndk_tests_defaults"],
44    srcs: [
45        "jni/shared_library_test.cc",
46        "jni/user_apk_test.cc",
47        "jni/jni_test.cc",
48        "jni/jni_test_main.cc",
49    ],
50    cflags: ["-DTMPFILE_TEMPLATE=\"/data/data/com.example.ndk_tests/cache/ndk-tests-XXXXXX\""],
51    header_libs: ["jni_headers"],
52    shared_libs: [
53        "liblog",
54        "libberberis_ndk_tests_shared_lib",
55        "libz",
56    ],
57    static_libs: [
58        "cpufeatures",
59        "libgtest_ndk_c++",
60    ],
61}
62
63android_test {
64    name: "ndk_tests_apk",
65    sdk_version: "current",
66
67    srcs: ["src/**/*.java"],
68    libs: [
69        "android.test.runner.stubs",
70        "android.test.base.stubs",
71    ],
72    jni_libs: [
73        "libberberis_ndk_tests",
74        "libberberis_ndk_tests_shared_lib",
75    ],
76    dex_preopt: {
77        enabled: false,
78    },
79}
80