aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2021-04-08 11:05:23 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-08 18:52:57 +0000
commitd340eb2015fbfca00769076a7169d5398f78bac9 (patch)
treecd7b58a58ac62b28a99709f597f384b19eabd6b3
parent87781081cea0443218721e5d79bbb2f07065a2ca (diff)
downloadComputeLibrary-d340eb2015fbfca00769076a7169d5398f78bac9.tar.gz
Skip tests that expect exception when asserts are off
When asserts are off, no exceptions are thrown. Therefore, we need to skip those tests and provide a message to inform the user. Resolves: COMPMID-4346 Change-Id: I5e4696fb7c97a5a6527620b5372f5a1c5e42f931 Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5381 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
-rw-r--r--tests/framework/Asserts.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/framework/Asserts.h b/tests/framework/Asserts.h
index b8a8fe091c..28d3da9a85 100644
--- a/tests/framework/Asserts.h
+++ b/tests/framework/Asserts.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -153,6 +153,7 @@ ARM_COMPUTE_TEST_COMP_FACTORY(ASSERT, Assertion, !=, NOT_EQUAL, throw arm_comput
arm_compute::test::framework::Framework::get().clear_test_info(); \
} while(false)
+#if defined(ARM_COMPUTE_ASSERTS_ENABLED)
#define ARM_COMPUTE_EXPECT_THROW(X, LEVEL) \
do \
{ \
@@ -175,6 +176,17 @@ ARM_COMPUTE_TEST_COMP_FACTORY(ASSERT, Assertion, !=, NOT_EQUAL, throw arm_comput
} \
arm_compute::test::framework::Framework::get().clear_test_info(); \
} while(false)
+#else // defined(ARM_COMPUTE_ASSERTS_ENABLED)
+#define ARM_COMPUTE_EXPECT_THROW(X, LEVEL) \
+ do \
+ { \
+ std::stringstream msg; \
+ msg << "'" #X "' Skipped: asserts disabled, cannot throw\n"; \
+ arm_compute::test::framework::Framework::get().print_test_info(msg); \
+ arm_compute::test::framework::Framework::get().log_info(msg.str()); \
+ arm_compute::test::framework::Framework::get().clear_test_info(); \
+ } while(false)
+#endif // defined(ARM_COMPUTE_ASSERTS_ENABLED)
#define ARM_COMPUTE_ASSERT_FAIL(MSG) \
do \