Print test information to the target device's logcat

Test: make vts -j99 && \
vts-tradefed run commandAndExit vts \
--skip-all-system-status-check --primary-abi-only \
--skip-preconditions --module VtsHalMediaOmxV1_0Test -l INFO

Bug: 62885431
Change-Id: I71bfa9c5ff4825259c7452ad7ac40fef87103b5f
This commit is contained in:
Pawin Vongmasa
2017-06-21 17:55:41 -07:00
parent c127be33b9
commit dd7e4c414b
6 changed files with 71 additions and 12 deletions

View File

@@ -129,12 +129,22 @@ static ComponentTestEnvironment* gEnv = nullptr;
// audio decoder test fixture class
class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
private:
typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
::std::string getTestCaseInfo() const override {
return ::std::string() +
"Component: " + gEnv->getComponent().c_str() + " | " +
"Role: " + gEnv->getRole().c_str() + " | " +
"Instance: " + gEnv->getInstance().c_str() + " | " +
"Res: " + gEnv->getRes().c_str();
}
virtual void SetUp() override {
Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
gEnv->getInstance());
omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -217,6 +227,7 @@ class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
Super::TearDown();
}
// callback function to process messages received by onMessages() from IL

View File

@@ -129,12 +129,22 @@ static ComponentTestEnvironment* gEnv = nullptr;
// audio encoder test fixture class
class AudioEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
private:
typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
::std::string getTestCaseInfo() const override {
return ::std::string() +
"Component: " + gEnv->getComponent().c_str() + " | " +
"Role: " + gEnv->getRole().c_str() + " | " +
"Instance: " + gEnv->getInstance().c_str() + " | " +
"Res: " + gEnv->getRes().c_str();
}
virtual void SetUp() override {
Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
gEnv->getInstance());
omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -204,6 +214,7 @@ class AudioEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
Super::TearDown();
}
// callback function to process messages received by onMessages() from IL

View File

@@ -117,12 +117,21 @@ static ComponentTestEnvironment* gEnv = nullptr;
// generic component test fixture class
class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase {
private:
typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
::std::string getTestCaseInfo() const override {
return ::std::string() +
"Component: " + gEnv->getComponent().c_str() + " | " +
"Role: " + gEnv->getRole().c_str() + " | " +
"Instance: " + gEnv->getInstance().c_str();
}
virtual void SetUp() override {
Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
gEnv->getInstance());
omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer = new CodecObserver(nullptr);
ASSERT_NE(observer, nullptr);
@@ -180,6 +189,7 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase {
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
Super::TearDown();
}
enum standardCompClass {

View File

@@ -97,17 +97,22 @@ class ComponentTestEnvironment : public ::testing::Environment {
static ComponentTestEnvironment* gEnv = nullptr;
class MasterHidlTest : public ::testing::VtsHalHidlTargetTestBase {
private:
typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
virtual void SetUp() override {
Super::SetUp();
omxStore = nullptr;
omxStore = ::testing::VtsHalHidlTargetTestBase::getService<IOmxStore>();
omxStore = Super::getService<IOmxStore>();
ASSERT_NE(omxStore, nullptr);
omx = nullptr;
omx = omxStore->getOmx(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
}
virtual void TearDown() override {}
virtual void TearDown() override {
Super::TearDown();
}
sp<IOmxStore> omxStore;
sp<IOmx> omx;

View File

@@ -134,12 +134,22 @@ static ComponentTestEnvironment* gEnv = nullptr;
// video decoder test fixture class
class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
private:
typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
::std::string getTestCaseInfo() const override {
return ::std::string() +
"Component: " + gEnv->getComponent().c_str() + " | " +
"Role: " + gEnv->getRole().c_str() + " | " +
"Instance: " + gEnv->getInstance().c_str() + " | " +
"Res: " + gEnv->getRes().c_str();
}
virtual void SetUp() override {
Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
gEnv->getInstance());
omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -223,6 +233,7 @@ class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase {
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
Super::TearDown();
}
// callback function to process messages received by onMessages() from IL

View File

@@ -147,12 +147,22 @@ static ComponentTestEnvironment* gEnv = nullptr;
// video encoder test fixture class
class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
private:
typedef ::testing::VtsHalHidlTargetTestBase Super;
public:
::std::string getTestCaseInfo() const override {
return ::std::string() +
"Component: " + gEnv->getComponent().c_str() + " | " +
"Role: " + gEnv->getRole().c_str() + " | " +
"Instance: " + gEnv->getInstance().c_str() + " | " +
"Res: " + gEnv->getRes().c_str();
}
virtual void SetUp() override {
Super::SetUp();
disableTest = false;
android::hardware::media::omx::V1_0::Status status;
omx = ::testing::VtsHalHidlTargetTestBase::getService<IOmx>(
gEnv->getInstance());
omx = Super::getService<IOmx>(gEnv->getInstance());
ASSERT_NE(omx, nullptr);
observer =
new CodecObserver([this](Message msg, const BufferInfo* buffer) {
@@ -235,6 +245,7 @@ class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
EXPECT_TRUE((omxNode->freeNode()).isOk());
omxNode = nullptr;
}
Super::TearDown();
}
// callback function to process messages received by onMessages() from IL