Build HalProxy unit tests with a test library ScopedWakelock

Unit tests do not currently build because they cannot find the
ScopedWakelock shared object. Make a test library version of
ScopedWakelock for them.

Test: Build and run atest android.hardware.sensors@2.0-halproxy-unit-tests
Change-Id: Ie8d3eb606ccba3825be2c8102b9a7bc6ea033f65
This commit is contained in:
Stan Rokita
2020-02-04 11:25:38 -08:00
parent d7975bf8d5
commit 8c51fca223
2 changed files with 16 additions and 1 deletions

View File

@@ -92,3 +92,18 @@ cc_test_library {
"android.hardware.sensors@2.0-ScopedWakelock",
],
}
cc_test_library {
name: "android.hardware.sensors@2.0-ScopedWakelock.testlib",
defaults: [
"hidl_defaults",
"android.hardware.sensors@2.0-multihal-defaults",
],
srcs: [
"ScopedWakelock.cpp",
],
vendor_available: true,
export_header_lib_headers: [
"android.hardware.sensors@2.0-multihal.header",
],
}

View File

@@ -80,11 +80,11 @@ cc_test {
static_libs: [
"android.hardware.sensors@2.0-HalProxy",
"android.hardware.sensors@2.0-fakesubhal-unittest",
"android.hardware.sensors@2.0-ScopedWakelock.testlib",
],
shared_libs: [
"android.hardware.sensors@1.0",
"android.hardware.sensors@2.0",
"android.hardware.sensors@2.0-ScopedWakelock",
"libbase",
"libcutils",
"libfmq",