IVGCVSW-4737 Add check for CpuRef back-end before using it in tests
authorFinn Williams <Finn.Williams@arm.com>
Tue, 12 May 2020 12:37:06 +0000 (13:37 +0100)
committerfinn.williams <finn.williams@arm.com>
Wed, 13 May 2020 10:57:20 +0000 (10:57 +0000)
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: Id7fbb7a39d2e9c7085636df44d4c8603a60cd4bf

src/profiling/test/FileOnlyProfilingDecoratorTests.cpp
tests/profiling/gatordmock/tests/GatordMockTests.cpp

index 164a94a..80236ae 100644 (file)
@@ -3,10 +3,7 @@
 // SPDX-License-Identifier: MIT
 //
 
-#include <armnn/utility/IgnoreUnused.hpp>
-#include <FileOnlyProfilingConnection.hpp>
 #include <Filesystem.hpp>
-#include <NullProfilingConnection.hpp>
 #include <ProfilingService.hpp>
 #include <Runtime.hpp>
 #include "PrintPacketHeaderHandler.hpp"
@@ -17,7 +14,6 @@
 #include <boost/test/unit_test.hpp>
 
 #include <cstdio>
-#include <fstream>
 #include <sstream>
 #include <sys/stat.h>
 
@@ -53,6 +49,12 @@ std::string UniqueFileName()
 
 BOOST_AUTO_TEST_CASE(TestFileOnlyProfiling)
 {
+    // This test requires the CpuRef backend to be enabled
+    if(!BackendRegistryInstance().IsBackendRegistered("CpuRef"))
+    {
+        return;
+    }
+
     // Create a temporary file name.
     boost::filesystem::path tempPath = boost::filesystem::temp_directory_path();
     boost::filesystem::path tempFile = UniqueFileName();
index 98ca8ff..0170962 100644 (file)
@@ -377,6 +377,11 @@ BOOST_AUTO_TEST_CASE(GatorDMockEndToEnd)
 
 BOOST_AUTO_TEST_CASE(GatorDMockTimeLineActivation)
 {
+    // This test requires the CpuRef backend to be enabled
+    if(!BackendRegistryInstance().IsBackendRegistered("CpuRef"))
+    {
+        return;
+    }
     armnn::MockBackendInitialiser initialiser;
     // Setup the mock service to bind to the UDS.
     std::string udsNamespace = "gatord_namespace";