aboutsummaryrefslogtreecommitdiff
path: root/tests/main.cpp
diff options
context:
space:
mode:
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())