Colin Cross | cf47d9b | 2016-07-27 10:35:53 -0700 | [diff] [blame] | 1 | // Build the unit tests. |
| 2 | |
| 3 | cc_test { |
| 4 | name: "JniInvocation_test", |
Dan Shi | 8ffbd0d | 2017-03-29 23:49:45 -0700 | [diff] [blame] | 5 | test_suites: ["device-tests"], |
Colin Cross | cf47d9b | 2016-07-27 10:35:53 -0700 | [diff] [blame] | 6 | host_supported: true, |
Nicolas Geoffray | 396b56f | 2017-12-09 12:48:21 +0000 | [diff] [blame] | 7 | srcs: ["JniInvocation_test.cpp"], |
Chih-Hung Hsieh | bc2a237 | 2017-10-03 10:39:11 -0700 | [diff] [blame] | 8 | cflags: ["-Wall", "-Werror"], |
Martin Stjernholm | 022ac4d | 2019-02-12 15:30:30 +0000 | [diff] [blame] | 9 | // Link to the non-stub version of the library to access some internal |
| 10 | // functions. |
| 11 | bootstrap: true, |
| 12 | shared_libs: ["libnativehelper"], |
Colin Cross | cf47d9b | 2016-07-27 10:35:53 -0700 | [diff] [blame] | 13 | } |
Igor Murashkin | a1969c4 | 2018-02-16 13:30:57 -0800 | [diff] [blame] | 14 | |
| 15 | cc_test { |
| 16 | name: "JniSafeRegisterNativeMethods_test", |
| 17 | host_supported: true, |
| 18 | srcs: ["JniSafeRegisterNativeMethods_test.cpp"], |
| 19 | |
| 20 | cflags: [ |
| 21 | // Base set of cflags used by all things ART. |
| 22 | "-fno-rtti", |
| 23 | "-ggdb3", |
| 24 | "-Wall", |
| 25 | "-Werror", |
| 26 | "-Wextra", |
| 27 | "-Wstrict-aliasing", |
| 28 | "-fstrict-aliasing", |
| 29 | "-Wunreachable-code", |
| 30 | "-Wredundant-decls", |
| 31 | "-Wshadow", |
| 32 | "-Wunused", |
| 33 | "-fvisibility=protected", |
| 34 | |
| 35 | // Warn about thread safety violations with clang. |
| 36 | "-Wthread-safety", |
| 37 | "-Wthread-safety-negative", |
| 38 | |
| 39 | // Warn if switch fallthroughs aren't annotated. |
| 40 | "-Wimplicit-fallthrough", |
| 41 | |
| 42 | // Enable float equality warnings. |
| 43 | "-Wfloat-equal", |
| 44 | |
| 45 | // Enable warning of converting ints to void*. |
| 46 | "-Wint-to-void-pointer-cast", |
| 47 | |
| 48 | // Enable warning of wrong unused annotations. |
| 49 | "-Wused-but-marked-unused", |
| 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 | |
Igor Murashkin | d8a0677 | 2018-03-06 14:15:46 -0800 | [diff] [blame] | 62 | tidy: true, |
| 63 | |
Igor Murashkin | a1969c4 | 2018-02-16 13:30:57 -0800 | [diff] [blame] | 64 | shared_libs: ["libnativehelper"], |
| 65 | } |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 66 | |
| 67 | cc_test { |
| 68 | name: "libnativehelper_api_test", |
| 69 | host_supported: true, |
| 70 | cflags: ["-Wall", "-Werror"], |
| 71 | srcs: ["libnativehelper_api_test.c"], // C Compilation test. |
| 72 | tidy: true, |
| 73 | shared_libs: ["libnativehelper"], |
Martin Stjernholm | 8f6839c | 2019-02-05 15:06:45 +0000 | [diff] [blame] | 74 | } |