IVGCVSW-5963 'Move unit tests to new framework'
* Used doctest in ArmNN unit tests
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a
diff --git a/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp
index 9720475..0539cd1 100644
--- a/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp
@@ -14,6 +14,8 @@
#include <test/TensorHelpers.hpp>
+#include <doctest/doctest.h>
+
namespace
{
@@ -69,7 +71,7 @@
std::cout.rdbuf(coutStreambuf);
- BOOST_TEST(oss.str() == expectedStringOutput);
+ CHECK(oss.str() == expectedStringOutput);
CopyDataFromITensorHandle(actualOutput.data(), outputHandle.get());
diff --git a/src/backends/backendsCommon/test/layerTests/DetectionPostProcessTestImpl.hpp b/src/backends/backendsCommon/test/layerTests/DetectionPostProcessTestImpl.hpp
index 143f9e0..2472c34 100644
--- a/src/backends/backendsCommon/test/layerTests/DetectionPostProcessTestImpl.hpp
+++ b/src/backends/backendsCommon/test/layerTests/DetectionPostProcessTestImpl.hpp
@@ -18,6 +18,8 @@
#include <test/TensorHelpers.hpp>
+#include <doctest/doctest.h>
+
namespace
{
@@ -221,25 +223,25 @@
expectedDetectionBoxes,
outputBoxesHandle->GetShape(),
detectionBoxesInfo.GetShape());
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
result = CompareTensors(actualDetectionClassesOutput,
expectedDetectionClasses,
classesHandle->GetShape(),
detectionClassesInfo.GetShape());
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
result = CompareTensors(actualDetectionScoresOutput,
expectedDetectionScores,
outputScoresHandle->GetShape(),
detectionScoresInfo.GetShape());
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
result = CompareTensors(actualNumDetectionOutput,
expectedNumDetections,
numDetectionHandle->GetShape(),
numDetectionInfo.GetShape());
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
}
template<armnn::DataType QuantizedType, typename RawType = armnn::ResolveType<QuantizedType>>
diff --git a/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
index 11003a2..035c592 100644
--- a/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
@@ -20,6 +20,7 @@
#include <test/TensorHelpers.hpp>
+#include <doctest/doctest.h>
namespace
{
@@ -45,11 +46,11 @@
// check shape and compare values
auto result = CompareTensors(batchVec, expectedOutput, expectedShape, expectedShape);
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
// check if iterator is back at start position
batchVecEncoder->Set(1.0f);
- BOOST_TEST(batchVec[0] == 1.0f);
+ CHECK(batchVec[0] == 1.0f);
}
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
@@ -72,11 +73,11 @@
// check shape and compare values
auto result = CompareTensors(input, expectedOutput, expectedShape, expectedShape);
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
// check if iterator is back at start position
outputEncoder->Set(1.0f);
- BOOST_TEST(input[0] == 1.0f);
+ CHECK(input[0] == 1.0f);
}
@@ -100,11 +101,11 @@
// check shape and compare values
auto result = CompareTensors(input, expectedOutput, expectedShape, expectedShape);
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
// check if iterator is back at start position
outputEncoder->Set(1.0f);
- BOOST_TEST(input[0] == 1.0f);
+ CHECK(input[0] == 1.0f);
}
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
@@ -129,11 +130,11 @@
// check shape and compare values
auto result = CompareTensors(batchVec, expectedOutput, expectedShape, expectedShape);
- BOOST_TEST(result.m_Result, result.m_Message.str());
+ CHECK_MESSAGE(result.m_Result, result.m_Message.str());
// check if iterator is back at start position
batchVecEncoder->Set(1.0f);
- BOOST_TEST(batchVec[0] == 1.0f);
+ CHECK(batchVec[0] == 1.0f);
}
// Lstm Layer tests:
diff --git a/src/backends/backendsCommon/test/layerTests/TransposeConvolution2dTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/TransposeConvolution2dTestImpl.cpp
index cd77572..dae7483 100644
--- a/src/backends/backendsCommon/test/layerTests/TransposeConvolution2dTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/TransposeConvolution2dTestImpl.cpp
@@ -20,7 +20,7 @@
#include <test/TensorHelpers.hpp>
-#include <boost/test/unit_test.hpp>
+#include <doctest/doctest.h>
#include <string>
#include <utility>