Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame^] | 1 | cc_defaults { |
| 2 | name: "libcompositionengine_defaults", |
| 3 | defaults: ["surfaceflinger_defaults"], |
| 4 | cflags: [ |
| 5 | "-DLOG_TAG=\"CompositionEngine\"", |
| 6 | ], |
| 7 | } |
| 8 | |
| 9 | cc_library { |
| 10 | name: "libcompositionengine", |
| 11 | defaults: ["libcompositionengine_defaults"], |
| 12 | srcs: [ |
| 13 | "src/CompositionEngine.cpp", |
| 14 | ], |
| 15 | local_include_dirs: ["include"], |
| 16 | export_include_dirs: ["include"], |
| 17 | } |
| 18 | |
| 19 | cc_library { |
| 20 | name: "libcompositionengine_mocks", |
| 21 | defaults: ["libcompositionengine_defaults"], |
| 22 | srcs: [ |
| 23 | "mock/CompositionEngine.cpp", |
| 24 | ], |
| 25 | static_libs: [ |
| 26 | "libgtest", |
| 27 | "libgmock", |
| 28 | "libcompositionengine", |
| 29 | ], |
| 30 | local_include_dirs: ["include"], |
| 31 | export_include_dirs: ["include"], |
| 32 | } |
| 33 | |
| 34 | cc_test { |
| 35 | name: "libcompositionengine_test", |
| 36 | test_suites: ["device-tests"], |
| 37 | defaults: ["libcompositionengine_defaults"], |
| 38 | srcs: [ |
| 39 | "tests/CompositionEngineTest.cpp", |
| 40 | ], |
| 41 | static_libs: [ |
| 42 | "libcompositionengine", |
| 43 | "libcompositionengine_mocks", |
| 44 | "libgmock", |
| 45 | "libgtest", |
| 46 | ], |
| 47 | sanitize: { |
| 48 | // By using the address sanitizer, we not only uncover any issues |
| 49 | // with the test, but also any issues with the code under test. |
| 50 | // |
| 51 | // Note: If you get an runtime link error like: |
| 52 | // |
| 53 | // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found |
| 54 | // |
| 55 | // it is because the address sanitizer shared objects are not installed |
| 56 | // by default in the system image. |
| 57 | // |
| 58 | // You can either "make dist tests" before flashing, or set this |
| 59 | // option to false temporarily. |
| 60 | address: true, |
| 61 | }, |
| 62 | } |