From 5396b25cba4bc7b42e741d3e0c29ccba5a5fc140 Mon Sep 17 00:00:00 2001 From: Tri Vo Date: Fri, 4 Aug 2017 14:42:31 -0700 Subject: [PATCH] Media omx tests static link to dependencies. These tests now statically link to libs not guaranteed to be on the device, which include HAL definition libs. Also, remove global include paths. Bug: 64040096 Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check --skip-preconditions --module VtsHalMediaOmxV1_0Host Change-Id: Iea1dc549704f61b1416357d72dc1bf26864978d4 --- media/omx/1.0/vts/functional/audio/Android.bp | 62 +++------------------ media/omx/1.0/vts/functional/common/Android.bp | 36 +++++++++--- media/omx/1.0/vts/functional/component/Android.bp | 27 +-------- media/omx/1.0/vts/functional/master/Android.bp | 24 +------- media/omx/1.0/vts/functional/video/Android.bp | 68 ++++------------------- 5 files changed, 51 insertions(+), 166 deletions(-) diff --git a/media/omx/1.0/vts/functional/audio/Android.bp b/media/omx/1.0/vts/functional/audio/Android.bp index 66fd20be..f517fa1d 100644 --- a/media/omx/1.0/vts/functional/audio/Android.bp +++ b/media/omx/1.0/vts/functional/audio/Android.bp @@ -16,65 +16,19 @@ cc_test { name: "VtsHalMediaOmxV1_0TargetAudioEncTest", - defaults: ["hidl_defaults"], - srcs: ["VtsHalMediaOmxV1_0TargetAudioEncTest.cpp", - "media_audio_hidl_test_common.cpp"], - shared_libs: [ - "libbase", - "liblog", - "libcutils", - "libhidlbase", - "libhidlmemory", - "libhidltransport", - "libhwbinder", - "libnativehelper", - "libutils", - "libstagefright_foundation", - "android.hidl.allocator@1.0", - "android.hidl.memory@1.0", - "android.hardware.media.omx@1.0", - ], - static_libs: ["VtsHalHidlTargetTestBase", - "VtsHalMediaOmxV1_0CommonUtil"], - cflags: [ - "-O0", - "-g", - ], - include_dirs: [ - "frameworks/native/include/media/openmax/", - "hardware/interfaces/media/omx/1.0/vts/functional/common", + defaults: ["VtsHalMediaOmxV1_0Defaults"], + srcs: [ + "VtsHalMediaOmxV1_0TargetAudioEncTest.cpp", + "media_audio_hidl_test_common.cpp" ], } cc_test { name: "VtsHalMediaOmxV1_0TargetAudioDecTest", - defaults: ["hidl_defaults"], - srcs: ["VtsHalMediaOmxV1_0TargetAudioDecTest.cpp", - "media_audio_hidl_test_common.cpp"], - shared_libs: [ - "libbase", - "liblog", - "libcutils", - "libhidlbase", - "libhidlmemory", - "libhidltransport", - "libhwbinder", - "libnativehelper", - "libutils", - "libstagefright_foundation", - "android.hidl.allocator@1.0", - "android.hidl.memory@1.0", - "android.hardware.media.omx@1.0", - ], - static_libs: ["VtsHalHidlTargetTestBase", - "VtsHalMediaOmxV1_0CommonUtil"], - cflags: [ - "-O0", - "-g", - ], - include_dirs: [ - "frameworks/native/include/media/openmax/", - "hardware/interfaces/media/omx/1.0/vts/functional/common", + defaults: ["VtsHalMediaOmxV1_0Defaults"], + srcs: [ + "VtsHalMediaOmxV1_0TargetAudioDecTest.cpp", + "media_audio_hidl_test_common.cpp" ], } diff --git a/media/omx/1.0/vts/functional/common/Android.bp b/media/omx/1.0/vts/functional/common/Android.bp index 93251fe8..af55e3a4 100755 --- a/media/omx/1.0/vts/functional/common/Android.bp +++ b/media/omx/1.0/vts/functional/common/Android.bp @@ -16,18 +16,40 @@ cc_library_static { name: "VtsHalMediaOmxV1_0CommonUtil", - defaults: ["hidl_defaults"], srcs: ["media_hidl_test_common.cpp"], - shared_libs: [ - "liblog", + + header_libs: ["media_plugin_headers"], + export_header_lib_headers: ["media_plugin_headers"], + export_include_dirs: ["."], + + static_libs: [ + "VtsHalHidlTargetTestBase", "libhidlmemory", "android.hidl.allocator@1.0", "android.hidl.memory@1.0", "android.hardware.media.omx@1.0", ], - static_libs: ["VtsHalHidlTargetTestBase"], - cflags: [ "-O0", "-g", ], - include_dirs: [ - "frameworks/native/include/media/openmax/", +} + +cc_defaults { + name: "VtsHalMediaOmxV1_0Defaults", + defaults: ["VtsHalTargetTestDefaults"], + + // Link to these statically as they are not guaranteed to be on the device. + static_libs: [ + "VtsHalMediaOmxV1_0CommonUtil", + "android.hardware.graphics.bufferqueue@1.0", + "android.hardware.graphics.common@1.0", + "android.hardware.media.omx@1.0", + "android.hardware.media@1.0", + "android.hidl.allocator@1.0", + "android.hidl.memory@1.0", + "libhidlmemory", + "libnativehelper", + ], + + // TODO(b/64437680): Assume these libs are always available on the device. + shared_libs: [ + "libstagefright_foundation", ], } diff --git a/media/omx/1.0/vts/functional/component/Android.bp b/media/omx/1.0/vts/functional/component/Android.bp index fd3210fb..f76b6e94 100644 --- a/media/omx/1.0/vts/functional/component/Android.bp +++ b/media/omx/1.0/vts/functional/component/Android.bp @@ -16,32 +16,7 @@ cc_test { name: "VtsHalMediaOmxV1_0TargetComponentTest", - defaults: ["hidl_defaults"], + defaults: ["VtsHalMediaOmxV1_0Defaults"], srcs: ["VtsHalMediaOmxV1_0TargetComponentTest.cpp"], - shared_libs: [ - "libbase", - "liblog", - "libcutils", - "libhidlbase", - "libhidlmemory", - "libhidltransport", - "libhwbinder", - "libnativehelper", - "libutils", - "libstagefright_foundation", - "android.hidl.allocator@1.0", - "android.hidl.memory@1.0", - "android.hardware.media.omx@1.0", - ], - static_libs: ["VtsHalHidlTargetTestBase", - "VtsHalMediaOmxV1_0CommonUtil"], - cflags: [ - "-O0", - "-g", - ], - include_dirs: [ - "frameworks/native/include/media/openmax/", - "hardware/interfaces/media/omx/1.0/vts/functional/common", - ], } diff --git a/media/omx/1.0/vts/functional/master/Android.bp b/media/omx/1.0/vts/functional/master/Android.bp index e24b79b8..4a45e692 100644 --- a/media/omx/1.0/vts/functional/master/Android.bp +++ b/media/omx/1.0/vts/functional/master/Android.bp @@ -16,29 +16,7 @@ cc_test { name: "VtsHalMediaOmxV1_0TargetMasterTest", - defaults: ["hidl_defaults"], + defaults: ["VtsHalMediaOmxV1_0Defaults"], srcs: ["VtsHalMediaOmxV1_0TargetMasterTest.cpp"], - shared_libs: [ - "libbase", - "liblog", - "libcutils", - "libhidlbase", - "libhidltransport", - "libhwbinder", - "libnativehelper", - "libutils", - "android.hidl.allocator@1.0", - "android.hidl.memory@1.0", - "android.hardware.media.omx@1.0", - ], - static_libs: ["VtsHalHidlTargetTestBase"], - cflags: [ - "-O0", - "-g", - ], - include_dirs: [ - "frameworks/native/include/media/openmax/", - "hardware/interfaces/media/omx/1.0/vts/functional/common", - ], } diff --git a/media/omx/1.0/vts/functional/video/Android.bp b/media/omx/1.0/vts/functional/video/Android.bp index 4e94f3b3..e251a15b 100644 --- a/media/omx/1.0/vts/functional/video/Android.bp +++ b/media/omx/1.0/vts/functional/video/Android.bp @@ -16,70 +16,26 @@ cc_test { name: "VtsHalMediaOmxV1_0TargetVideoDecTest", - defaults: ["hidl_defaults"], - srcs: ["VtsHalMediaOmxV1_0TargetVideoDecTest.cpp", - "media_video_hidl_test_common.cpp"], - shared_libs: [ - "libbase", - "liblog", - "libcutils", - "libhidlbase", - "libhidlmemory", - "libhidltransport", - "libhwbinder", - "libnativehelper", - "libutils", - "libstagefright_foundation", - "android.hidl.allocator@1.0", - "android.hidl.memory@1.0", - "android.hardware.media.omx@1.0", + defaults: ["VtsHalMediaOmxV1_0Defaults"], + srcs: [ + "VtsHalMediaOmxV1_0TargetVideoDecTest.cpp", + "media_video_hidl_test_common.cpp" + ], + static_libs: [ "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.common@1.0", - ], - static_libs: ["VtsHalHidlTargetTestBase", - "VtsHalMediaOmxV1_0CommonUtil"], - cflags: [ - "-O0", - "-g", - ], - include_dirs: [ - "frameworks/native/include/media/openmax/", - "hardware/interfaces/media/omx/1.0/vts/functional/common", ], } cc_test { name: "VtsHalMediaOmxV1_0TargetVideoEncTest", - defaults: ["hidl_defaults"], - srcs: ["VtsHalMediaOmxV1_0TargetVideoEncTest.cpp", - "media_video_hidl_test_common.cpp"], - shared_libs: [ - "libbase", - "liblog", - "libcutils", - "libhidlbase", - "libhidlmemory", - "libhidltransport", - "libhwbinder", - "libnativehelper", + defaults: ["VtsHalMediaOmxV1_0Defaults"], + srcs: [ + "VtsHalMediaOmxV1_0TargetVideoEncTest.cpp", + "media_video_hidl_test_common.cpp" + ], + static_libs: [ "libnativewindow", - "libutils", - "libstagefright_foundation", - "android.hidl.allocator@1.0", - "android.hidl.memory@1.0", - "android.hardware.media.omx@1.0", - "android.hardware.graphics.bufferqueue@1.0", "android.hardware.graphics.mapper@2.0", ], - static_libs: ["VtsHalHidlTargetTestBase", - "VtsHalMediaOmxV1_0CommonUtil"], - cflags: [ - "-O0", - "-g", - ], - include_dirs: [ - "frameworks/native/include/media/openmax/", - "hardware/interfaces/media/omx/1.0/vts/functional/common", - ], } -- 2.11.0