audio: Add VTS execution tracer
Add Execution listener in VTS tests to get information
about test execution steps like, start, stop and failure messages
in logcat message.
Bug: 287168985
Test: run vts-hal-audio
Change-Id: Ie69a7bf78076c17d7b623d75748fa0fdbdba6b1e
diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index b559669..191e980 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -22,11 +22,21 @@
#include <android/binder_auto_utils.h>
#include <gtest/gtest.h>
+#include <system/audio_aidl_utils.h>
namespace android::hardware::audio::common::testing {
namespace detail {
+class TestExecutionTracer : public ::testing::EmptyTestEventListener {
+ public:
+ void OnTestStart(const ::testing::TestInfo& test_info) override;
+ void OnTestEnd(const ::testing::TestInfo& test_info) override;
+ void OnTestPartResult(const ::testing::TestPartResult& result) override;
+ private:
+ static void TraceTestState(const std::string& state, const ::testing::TestInfo& test_info);
+};
+
inline ::testing::AssertionResult assertIsOk(const char* expr, const ::ndk::ScopedAStatus& status) {
if (status.isOk()) {
return ::testing::AssertionSuccess();