aboutsummaryrefslogtreecommitdiff
path: root/tests/main.cpp
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2017-10-03 14:01:05 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commite1f8f9b976cec4af84e5beee1109912f36096f5c (patch)
tree4474426105f52d35cc977d2c974d616d246a9e9c /tests/main.cpp
parent7ce53c620b50c718bac62017d28072cf61457233 (diff)
downloadComputeLibrary-e1f8f9b976cec4af84e5beee1109912f36096f5c.tar.gz
COMPMID-556 Add test for instruments
Change-Id: Ieff79255b013cfcc1bae871276ab94722ab0b7c6 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/90002 Reviewed-by: Pablo Tello <pablo.tello@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/main.cpp')
-rw-r--r--tests/main.cpp15
1 files changed, 15 insertions, 0 deletions
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<framework::ToggleOption>("list-tests", false);
list_tests->set_help("List all test names");
+ auto test_instruments = parser.add_option<framework::ToggleOption>("test-instruments", false);
+ test_instruments->set_help("Test if the instruments work on the platform");
auto error_on_missing_assets = parser.add_option<framework::ToggleOption>("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<framework::SimpleOption<std::string>>("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<AssetsLibrary>(assets->value(), seed->value());
if(!parser.validate())