summaryrefslogtreecommitdiffstats
path: root/drm/1.0
diff options
context:
space:
mode:
authorZhuoyao Zhang <zhuoyao@google.com>2018-02-13 15:24:25 -0800
committerZhuoyao Zhang <zhuoyao@google.com>2018-02-13 15:25:59 -0800
commitcf50a32e57140b29d65e370cf0808ad91978d969 (patch)
tree0308259d38830ccfe201e18f6a774ccd85619bda /drm/1.0
parent6b0b8669f3dfa8e7fb77c8a965758efa4154e769 (diff)
downloadandroid_hardware_interfaces-cf50a32e57140b29d65e370cf0808ad91978d969.tar.gz
android_hardware_interfaces-cf50a32e57140b29d65e370cf0808ad91978d969.tar.bz2
android_hardware_interfaces-cf50a32e57140b29d65e370cf0808ad91978d969.zip
Convert drm hal test to use VtsHalHidlTargetTestEnvBase
* The testEnvBase template is only used to register the testing hal. * The service name is specifically determined by the test logic, so disable the feature for vts to run the test against all service instance (by setting HalServiceCombMode::NO_COMBINATION) Bug: 64203181 Test: make vts vts-tradefed run vts -m VtsHalDrmV1_0Target vts-tradefed run vts -m VtsHalDrmV1_1Target Change-Id: Ib2e005e8ccbc815067f0e9455fcd3e6c5ec151fb
Diffstat (limited to 'drm/1.0')
-rw-r--r--drm/1.0/vts/functional/drm_hal_vendor_test.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/drm/1.0/vts/functional/drm_hal_vendor_test.cpp b/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
index 47c6950cd..d03b2af37 100644
--- a/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
+++ b/drm/1.0/vts/functional/drm_hal_vendor_test.cpp
@@ -97,6 +97,27 @@ static const uint8_t kInvalidUUID[16] = {
static drm_vts::VendorModules* gVendorModules = nullptr;
+// Test environment for drm
+class DrmHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
+ public:
+ // get the test environment singleton
+ static DrmHidlEnvironment* Instance() {
+ static DrmHidlEnvironment* instance = new DrmHidlEnvironment;
+ return instance;
+ }
+
+ void registerTestServices() override {
+ registerTestService<ICryptoFactory>();
+ registerTestService<IDrmFactory>();
+ setServiceCombMode(::testing::HalServiceCombMode::NO_COMBINATION);
+ }
+
+ private:
+ DrmHidlEnvironment() {}
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(DrmHidlEnvironment);
+};
+
class DrmHalVendorFactoryTest : public testing::TestWithParam<std::string> {
public:
DrmHalVendorFactoryTest()
@@ -1598,6 +1619,10 @@ int main(int argc, char** argv) {
std::cerr << "WARNING: No vendor modules found in " << kModulePath <<
", all vendor tests will be skipped" << std::endl;
}
+ ::testing::AddGlobalTestEnvironment(DrmHidlEnvironment::Instance());
::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
+ DrmHidlEnvironment::Instance()->init(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ ALOGI("Test result = %d", status);
+ return status;
}