Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2336a17 authored by Yuexi Ma's avatar Yuexi Ma Committed by Android (Google) Code Review
Browse files

Merge "Add coverage to tv_input, tv_cec, and vehicle vts hal tests"

parents 1b2a09e5 a7cb8ba6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ from vts.proto import ComponentSpecificationMessage_pb2 as CompSpecMsg
from vts.runners.host import asserts
from vts.runners.host import base_test_with_webdb
from vts.runners.host import const
from vts.runners.host import keys
from vts.runners.host import test_runner
from vts.utils.python.controllers import android_device
from vts.utils.python.coverage import coverage_utils


class TvCecHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
@@ -38,6 +40,9 @@ class TvCecHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
        self.dut.shell.one.Execute(
            "setprop vts.hal.vts.hidl.get_stub true")

        if getattr(self, keys.ConfigKeys.IKEY_ENABLE_COVERAGE, False):
            coverage_utils.InitializeDeviceCoverage(self.dut)

        self.dut.hal.InitHidlHal(
            target_type="tv_cec",
            target_basepaths=self.dut.libPaths,
@@ -47,6 +52,11 @@ class TvCecHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
            hw_binder_service_name="cec-hal-1-0",
            bits=64 if self.dut.is64Bit else 32)

    def tearDownClass(self):
        """To be executed when all test cases are finished."""
        if getattr(self, keys.ConfigKeys.IKEY_ENABLE_COVERAGE, False):
            self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut))

    def testGetCecVersion1(self):
        """A simple test case which queries the cec version."""
        logging.info('DIR HAL %s', dir(self.dut.hal))
+10 −0
Original line number Diff line number Diff line
@@ -20,8 +20,10 @@ import logging
from vts.runners.host import asserts
from vts.runners.host import base_test_with_webdb
from vts.runners.host import const
from vts.runners.host import keys
from vts.runners.host import test_runner
from vts.utils.python.controllers import android_device
from vts.utils.python.coverage import coverage_utils


class TvInputHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
@@ -34,6 +36,9 @@ class TvInputHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
        self.dut.shell.InvokeTerminal("one")
        self.dut.shell.one.Execute("setenforce 0")  # SELinux permissive mode

        if getattr(self, keys.ConfigKeys.IKEY_ENABLE_COVERAGE, False):
            coverage_utils.InitializeDeviceCoverage(self.dut)

        self.dut.hal.InitHidlHal(target_type="tv_input",
                                 target_basepaths=["/system/lib64"],
                                 target_version=1.0,
@@ -43,6 +48,11 @@ class TvInputHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):

        self.dut.shell.InvokeTerminal("one")

    def tearDownClass(self):
        """To be executed when all test cases are finished."""
        if getattr(self, keys.ConfigKeys.IKEY_ENABLE_COVERAGE, False):
            self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut))

    def testGetStreamConfigurations(self):
        configs = self.dut.hal.tv_input.getStreamConfigurations(0)
        logging.info('return value of getStreamConfigurations(0): %s', configs)
+8 −0
Original line number Diff line number Diff line
@@ -21,9 +21,11 @@ import time
from vts.runners.host import asserts
from vts.runners.host import base_test_with_webdb
from vts.runners.host import const
from vts.runners.host import keys
from vts.runners.host import test_runner
from vts.utils.python.controllers import android_device
from vts.utils.python.profiling import profiling_utils
from vts.utils.python.coverage import coverage_utils


class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
@@ -40,6 +42,9 @@ class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
        system_uid = results[const.STDOUT][0].strip()
        logging.info("system_uid: %s", system_uid)

        if getattr(self, keys.ConfigKeys.IKEY_ENABLE_COVERAGE, False):
            coverage_utils.InitializeDeviceCoverage(self.dut)

        self.dut.hal.InitHidlHal(
            target_type="vehicle",
            target_basepaths=self.dut.libPaths,
@@ -63,6 +68,9 @@ class VehicleHidlTest(base_test_with_webdb.BaseTestWithWebDbClass):
        if self.enable_profiling:
            self.ProcessAndUploadTraceData()

        if getattr(self, keys.ConfigKeys.IKEY_ENABLE_COVERAGE, False):
            self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut))

    def setUpTest(self):
        if self.enable_profiling:
            profiling_utils.EnableVTSProfiling(self.dut.shell.one)