aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/instruments
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-04-20 15:46:21 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:54 +0000
commit9fb0cac961f70d1937c5fa3eafeaee1385c89768 (patch)
tree9a8847053f65631e050c231645549adb48c92fb8 /tests/framework/instruments
parentfda901f0485371e8b6a807c8dd9614560a924793 (diff)
downloadComputeLibrary-9fb0cac961f70d1937c5fa3eafeaee1385c89768.tar.gz
COMPMID-1081: Introduced test-wide instruments
Change-Id: I5831241f3fc503717cc51136453c2bf96d4b420b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128484 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/framework/instruments')
-rw-r--r--tests/framework/instruments/Instrument.h51
1 files changed, 44 insertions, 7 deletions
diff --git a/tests/framework/instruments/Instrument.h b/tests/framework/instruments/Instrument.h
index 0df53f4210..ae4644b200 100644
--- a/tests/framework/instruments/Instrument.h
+++ b/tests/framework/instruments/Instrument.h
@@ -74,20 +74,57 @@ public:
/** Identifier for the instrument */
virtual std::string id() const = 0;
- /** Start measuring. */
- virtual void start() = 0;
+ /** Start of the test
+ *
+ * Called before the test set up starts
+ */
+ virtual void test_start()
+ {
+ }
+
+ /** Start measuring.
+ *
+ * Called just before the run of the test starts
+ */
+ virtual void start()
+ {
+ }
- /** Stop measuring. */
- virtual void stop() = 0;
+ /** Stop measuring.
+ *
+ * Called just after the run of the test ends
+ */
+ virtual void stop()
+ {
+ }
+ /** End of the test
+ *
+ * Called after the test teardown ended
+ */
+ virtual void test_stop()
+ {
+ }
/** Map of measurements */
using MeasurementsMap = std::map<std::string, Measurement>;
- /** Return the latest measurement.
+ /** Return the latest measurements.
+ *
+ * @return the latest measurements.
+ */
+ virtual MeasurementsMap measurements() const
+ {
+ return MeasurementsMap();
+ }
+
+ /** Return the latest test measurements.
*
- * @return the latest measurement.
+ * @return the latest test measurements.
*/
- virtual MeasurementsMap measurements() const = 0;
+ virtual MeasurementsMap test_measurements() const
+ {
+ return MeasurementsMap();
+ }
protected:
std::string _unit{};