diff options
author | Keith Davis <keith.davis@arm.com> | 2019-08-26 18:28:17 +0100 |
---|---|---|
committer | Jim Flynn Arm <jim.flynn@arm.com> | 2019-09-05 16:18:42 +0000 |
commit | 02356de9da5d5480b4b9b413d1b6b33daf7ab717 (patch) | |
tree | 5ea3b7c7170f34ef5166c50291e213aec6204440 /src/profiling/test | |
parent | 0696569fbfb76b485624de24462aaf10d84f415d (diff) | |
download | armnn-02356de9da5d5480b4b9b413d1b6b33daf7ab717.tar.gz |
IVGCVSW-3674 Create basic ProfileService class
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: I5bed5196c256883fb704fe14b60bb8f7a77cc9df
Diffstat (limited to 'src/profiling/test')
-rw-r--r-- | src/profiling/test/ProfilingTests.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index 58609528e4..57d8dd1ace 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -12,6 +12,8 @@ #include "../PacketVersionResolver.hpp" #include "../ProfilingStateMachine.hpp" +#include "../ProfilingService.hpp" + #include <boost/test/unit_test.hpp> #include <cstdint> @@ -450,7 +452,41 @@ BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) BOOST_CHECK(copyConstructedCaptureData.GetCapturePeriod() == 3); BOOST_CHECK(copyConstructedCaptureData.GetCounterIds() == counterIds3); +} + +BOOST_AUTO_TEST_CASE(CheckProfilingServiceDisabled) +{ + armnn::Runtime::CreationOptions::ExternalProfilingOptions options; + ProfilingService service(options); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::Uninitialised); + service.Run(); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::Uninitialised); +} + +BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabled) +{ + armnn::Runtime::CreationOptions::ExternalProfilingOptions options; + options.m_EnableProfiling = true; + ProfilingService service(options); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::NotConnected); + service.Run(); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::WaitingForAck); +} + + +BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabledRuntime) +{ + armnn::Runtime::CreationOptions::ExternalProfilingOptions options; + ProfilingService service(options); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::Uninitialised); + service.Run(); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::Uninitialised); + service.m_Options.m_EnableProfiling = true; + service.Run(); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::NotConnected); + service.Run(); + BOOST_CHECK(service.GetCurrentState() == ProfilingState::WaitingForAck); } BOOST_AUTO_TEST_SUITE_END() |