From e1f8f9b976cec4af84e5beee1109912f36096f5c Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Tue, 3 Oct 2017 14:01:05 +0100 Subject: COMPMID-556 Add test for instruments Change-Id: Ieff79255b013cfcc1bae871276ab94722ab0b7c6 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/90002 Reviewed-by: Pablo Tello Tested-by: Kaizen --- tests/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/main.cpp') diff --git a/tests/main.cpp b/tests/main.cpp index 230d856958..e70da59484 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -27,6 +27,7 @@ #include "tests/framework/Exceptions.h" #include "tests/framework/Framework.h" #include "tests/framework/Macros.h" +#include "tests/framework/Profiler.h" #include "tests/framework/command_line/CommandLineOptions.h" #include "tests/framework/command_line/CommandLineParser.h" #include "tests/framework/instruments/Instruments.h" @@ -131,6 +132,8 @@ int main(int argc, char **argv) color_output->set_help("Produce colored output on the console"); auto list_tests = parser.add_option("list-tests", false); list_tests->set_help("List all test names"); + auto test_instruments = parser.add_option("test-instruments", false); + test_instruments->set_help("Test if the instruments work on the platform"); auto error_on_missing_assets = parser.add_option("error-on-missing-assets", false); error_on_missing_assets->set_help("Mark a test as failed instead of skipping it when assets are missing"); auto assets = parser.add_positional_option>("assets"); @@ -211,6 +214,18 @@ int main(int argc, char **argv) return 0; } + if(test_instruments->value()) + { + framework::Profiler profiler = framework.get_profiler(); + profiler.start(); + profiler.stop(); + if(printer != nullptr) + { + printer->print_measurements(profiler.measurements()); + } + return 0; + } + library = support::cpp14::make_unique(assets->value(), seed->value()); if(!parser.validate()) -- cgit v1.2.1