Loading audio/aidl/vts/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,10 @@ cc_defaults { "general-tests", "vts", ], srcs: [":effectCommonFile"], srcs: [ ":effectCommonFile", "TestUtils.cpp", ], } cc_test { Loading audio/aidl/vts/TestUtils.cpp 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "TestUtils.h" #define LOG_TAG "VtsHalAudio_TestUtils" #include <android-base/logging.h> namespace android::hardware::audio::common::testing { namespace detail { void TestExecutionTracer::OnTestStart(const ::testing::TestInfo& test_info) { TraceTestState("Started", test_info); } void TestExecutionTracer::OnTestEnd(const ::testing::TestInfo& test_info) { TraceTestState("Completed", test_info); } void TestExecutionTracer::OnTestPartResult(const ::testing::TestPartResult& result) { LOG(INFO) << result; } void TestExecutionTracer::TraceTestState(const std::string& state, const ::testing::TestInfo& test_info) { LOG(INFO) << state << " " << test_info.test_suite_name() << "::" << test_info.name(); } } } No newline at end of file audio/aidl/vts/TestUtils.h +10 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading audio/aidl/vts/VtsHalAECTargetTest.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Range; using android::hardware::audio::common::testing::detail::TestExecutionTracer; enum ParamName { PARAM_INSTANCE_NAME, PARAM_ECHO_DELAY, PARAM_MOBILE_MODE }; using AECParamTestParam = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, Loading Loading @@ -178,6 +179,7 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AECParamTest); int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); ::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer()); ABinderProcess_setThreadPoolMaxThreadCount(1); ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); Loading audio/aidl/vts/VtsHalAGC1TargetTest.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainCont using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; using aidl::android::hardware::audio::effect::Parameter; using android::hardware::audio::common::testing::detail::TestExecutionTracer; enum ParamName { PARAM_INSTANCE_NAME, Loading Loading @@ -189,6 +190,7 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AGC1ParamTest); int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); ::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer()); ABinderProcess_setThreadPoolMaxThreadCount(1); ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); Loading Loading
audio/aidl/vts/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,10 @@ cc_defaults { "general-tests", "vts", ], srcs: [":effectCommonFile"], srcs: [ ":effectCommonFile", "TestUtils.cpp", ], } cc_test { Loading
audio/aidl/vts/TestUtils.cpp 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "TestUtils.h" #define LOG_TAG "VtsHalAudio_TestUtils" #include <android-base/logging.h> namespace android::hardware::audio::common::testing { namespace detail { void TestExecutionTracer::OnTestStart(const ::testing::TestInfo& test_info) { TraceTestState("Started", test_info); } void TestExecutionTracer::OnTestEnd(const ::testing::TestInfo& test_info) { TraceTestState("Completed", test_info); } void TestExecutionTracer::OnTestPartResult(const ::testing::TestPartResult& result) { LOG(INFO) << result; } void TestExecutionTracer::TraceTestState(const std::string& state, const ::testing::TestInfo& test_info) { LOG(INFO) << state << " " << test_info.test_suite_name() << "::" << test_info.name(); } } } No newline at end of file
audio/aidl/vts/TestUtils.h +10 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading
audio/aidl/vts/VtsHalAECTargetTest.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Range; using android::hardware::audio::common::testing::detail::TestExecutionTracer; enum ParamName { PARAM_INSTANCE_NAME, PARAM_ECHO_DELAY, PARAM_MOBILE_MODE }; using AECParamTestParam = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, Loading Loading @@ -178,6 +179,7 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AECParamTest); int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); ::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer()); ABinderProcess_setThreadPoolMaxThreadCount(1); ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); Loading
audio/aidl/vts/VtsHalAGC1TargetTest.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainCont using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; using aidl::android::hardware::audio::effect::Parameter; using android::hardware::audio::common::testing::detail::TestExecutionTracer; enum ParamName { PARAM_INSTANCE_NAME, Loading Loading @@ -189,6 +190,7 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AGC1ParamTest); int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); ::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer()); ABinderProcess_setThreadPoolMaxThreadCount(1); ABinderProcess_startThreadPool(); return RUN_ALL_TESTS(); Loading