From 9fb0cac961f70d1937c5fa3eafeaee1385c89768 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 20 Apr 2018 15:46:21 +0100 Subject: COMPMID-1081: Introduced test-wide instruments Change-Id: I5831241f3fc503717cc51136453c2bf96d4b420b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128484 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- tests/framework/instruments/Instrument.h | 51 +++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 7 deletions(-) (limited to 'tests/framework/instruments/Instrument.h') 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; - /** 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{}; -- cgit v1.2.1