summaryrefslogtreecommitdiff
path: root/tests/common/ProfilerTests.cc
diff options
context:
space:
mode:
authorLiam Barry <liam.barry@arm.com>2023-09-27 12:48:35 +0100
committerNina Drozd <nina.drozd@arm.com>2023-10-04 09:35:11 +0100
commitf30d7413b2ba6625dc0f86ca540694a2a349dd54 (patch)
tree4338d35657fb29093f51bc0c9ad7cc3ed7f68f3b /tests/common/ProfilerTests.cc
parent9263b519eef9aea86dcd795b16acd1ae53e19b9c (diff)
downloadml-embedded-evaluation-kit-f30d7413b2ba6625dc0f86ca540694a2a349dd54.tar.gz
MLECO-4365: Add CI Test for insufficient tensor arena and update common tests.
Previously, execution path following failed tensor allocation was not covered by tests. Minor amendment added to make ~Model virtual. During testing it was noticed that intentional errors simulated in certain common tests would result in misleading output for subsequent tests as the error messages appear in the console output of the next failing test. Documentation and print statements added until a solution is found. Change-Id: Iaf3e0f32ce9e0505921251cd41f73030108d2cb1 Signed-off-by: Liam Barry <liam.barry@arm.com>
Diffstat (limited to 'tests/common/ProfilerTests.cc')
-rw-r--r--tests/common/ProfilerTests.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/common/ProfilerTests.cc b/tests/common/ProfilerTests.cc
index 62c7347..0b487e5 100644
--- a/tests/common/ProfilerTests.cc
+++ b/tests/common/ProfilerTests.cc
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2021, 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -41,10 +41,17 @@ TEST_CASE("Common: Test Profiler")
profilerValid.GetAllResultsAndReset(results);
REQUIRE(results.size() == 1);
REQUIRE(results[0].name == "test_valid");
- /* Abuse should still fail: */
+
+ /* Improper usage should cause failure.
+ * Note: Errors or warnings generated by this test will appear in output of any subsequent
+ * failing tests causing misleading output. Give warning until solution is found */
+ printf("Invalid profiler usage common test output:\n");
REQUIRE(false == profilerValid.StopProfiling()); /* We need to start it first */
+
REQUIRE(true == profilerValid.StartProfiling()); /* Should be able to start it fine */
REQUIRE(false == profilerValid.StartProfiling()); /* Can't restart it without resetting */
+ printf("End of Invalid profiler usage common test output. \nERROR messages above this line "
+ "are expected and can be ignored.\n\n");
profilerValid.Reset();
REQUIRE(true == profilerValid.StartProfiling()); /* Can start it again now.. */
REQUIRE(true == profilerValid.StopProfiling());