• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Build the unit tests.
2
3cc_test {
4    name: "JniInvocation_test",
5    test_suites: ["device-tests"],
6    host_supported: true,
7    srcs: ["JniInvocation_test.cpp"],
8    cflags: [
9        "-Wall",
10        "-Werror",
11    ],
12    // Link to the non-stub version of the library to access some internal
13    // functions.
14    bootstrap: true,
15    shared_libs: ["libnativehelper"],
16}
17
18cc_test {
19    name: "JniSafeRegisterNativeMethods_test",
20    host_supported: true,
21    srcs: ["JniSafeRegisterNativeMethods_test.cpp"],
22
23    cflags: [
24        // Base set of cflags used by all things ART.
25        "-fno-rtti",
26        "-ggdb3",
27        "-Wall",
28        "-Werror",
29        "-Wextra",
30        "-Wstrict-aliasing",
31        "-fstrict-aliasing",
32        "-Wunreachable-code",
33        "-Wredundant-decls",
34        "-Wshadow",
35        "-Wunused",
36        "-fvisibility=protected",
37
38        // Warn about thread safety violations with clang.
39        "-Wthread-safety",
40        "-Wthread-safety-negative",
41
42        // Warn if switch fallthroughs aren't annotated.
43        "-Wimplicit-fallthrough",
44
45        // Enable float equality warnings.
46        "-Wfloat-equal",
47
48        // Enable warning of converting ints to void*.
49        "-Wint-to-void-pointer-cast",
50
51        // Enable warning for deprecated language features.
52        "-Wdeprecated",
53
54        // Enable warning for unreachable break & return.
55        "-Wunreachable-code-break",
56        "-Wunreachable-code-return",
57
58        // Enable thread annotations for std::mutex, etc.
59        "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
60    ],
61
62    tidy: true,
63
64    shared_libs: ["libnativehelper"],
65}
66
67cc_test {
68    name: "libnativehelper_api_test",
69    host_supported: true,
70    cflags: [
71        "-Wall",
72        "-Werror",
73    ],
74    srcs: ["libnativehelper_api_test.c"], // C Compilation test.
75    tidy: true,
76    shared_libs: ["libnativehelper"],
77}
78