diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-05-26 15:40:53 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-09 14:50:34 +0000 |
commit | 9150bff63a690caa743c471943afe509ebed1044 (patch) | |
tree | f98047d0a3a0e6cf06a4f34e0270a3cc7e3ee8bd /test/Tests.cpp | |
parent | 07648f41d8b1fe9f532fa9c7e8e96a8e3651e59d (diff) | |
download | android-nn-driver-9150bff63a690caa743c471943afe509ebed1044.tar.gz |
IVGCVSW-4618 'Transition Units Test Suites'
* Used doctest in android-nn-driver unit tests.
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I9b5d4dfd77d53c7ebee7f8c43628a1d6ff74d1a3
Diffstat (limited to 'test/Tests.cpp')
-rw-r--r-- | test/Tests.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/test/Tests.cpp b/test/Tests.cpp index 0ef142d9..a3a38b91 100644 --- a/test/Tests.cpp +++ b/test/Tests.cpp @@ -3,29 +3,33 @@ // SPDX-License-Identifier: MIT // #define LOG_TAG "ArmnnDriverTests" -#define BOOST_TEST_MODULE armnn_driver_tests -#include <boost/test/unit_test.hpp> #include <log/log.h> #include "DriverTestHelpers.hpp" -BOOST_AUTO_TEST_SUITE(DriverTests) +#ifndef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#endif +#include <doctest/doctest.h> using namespace android::hardware; using namespace driverTestHelpers; using namespace armnn_driver; -BOOST_AUTO_TEST_CASE(Init) +TEST_SUITE("DriverTests") +{ + +TEST_CASE("Init") { // Making the driver object on the stack causes a weird libc error, so make it on the heap instead auto driver = std::make_unique<ArmnnDriver>(DriverOptions(armnn::Compute::CpuRef)); V1_0::DeviceStatus status = driver->getStatus(); - // Note double-parentheses to avoid compile error from Boost trying to printf the DeviceStatus - BOOST_TEST((status == V1_0::DeviceStatus::AVAILABLE)); + // Note double-parentheses to avoid compile error from doctest trying to printf the DeviceStatus + CHECK((status == V1_0::DeviceStatus::AVAILABLE)); } -BOOST_AUTO_TEST_CASE(TestCapabilities) +TEST_CASE("TestCapabilities") { // Making the driver object on the stack causes a weird libc error, so make it on the heap instead auto driver = std::make_unique<ArmnnDriver>(DriverOptions(armnn::Compute::CpuRef)); @@ -41,11 +45,11 @@ BOOST_AUTO_TEST_CASE(TestCapabilities) driver->getCapabilities(cb); - BOOST_TEST((int)error == (int)V1_0::ErrorStatus::NONE); - BOOST_TEST(cap.float32Performance.execTime > 0.f); - BOOST_TEST(cap.float32Performance.powerUsage > 0.f); - BOOST_TEST(cap.quantized8Performance.execTime > 0.f); - BOOST_TEST(cap.quantized8Performance.powerUsage > 0.f); + CHECK((int)error == (int)V1_0::ErrorStatus::NONE); + CHECK(cap.float32Performance.execTime > 0.f); + CHECK(cap.float32Performance.powerUsage > 0.f); + CHECK(cap.quantized8Performance.execTime > 0.f); + CHECK(cap.quantized8Performance.powerUsage > 0.f); } -BOOST_AUTO_TEST_SUITE_END() +} |