26 #include "../Framework.h" 27 #include "../instruments/InstrumentsStats.h" 28 #include "../instruments/Measurement.h" 38 std::string PrettyPrinter::begin_color(
const std::string &color)
const 45 return "\033[0;3" + color +
"m";
48 std::string PrettyPrinter::end_color()
const 60 _color_output = color_output;
65 *_stream << begin_color(
"4") << name <<
" = " << value << end_color() <<
"\n";
86 *_stream << begin_color(
"2") <<
"Running [" << info.
id <<
"] '" << info.
name <<
"'" << end_color() <<
"\n";
103 *_stream << begin_color(
"1") <<
"INFO: " << info << end_color() <<
"\n";
108 std::string prefix = expected ?
"EXPECTED ERROR: " :
"ERROR: ";
109 *_stream << begin_color(
"1") << prefix << error.what() << end_color() <<
"\n";
114 for(
auto const &
info : infos)
116 *_stream <<
"[" <<
info.id <<
", " <<
info.mode <<
", " <<
info.status <<
"] " <<
info.name <<
"\n";
121 for(
const auto &instrument : measurements)
123 *_stream << begin_color(
"3") <<
" " << instrument.first <<
":";
128 *_stream <<
"AVG=" << stats.
mean() <<
" " << stats.
max().
unit();
129 if(instrument.second.size() > 1)
132 *_stream <<
", MIN=" << stats.
min();
133 *_stream <<
", MAX=" << stats.
max();
136 *_stream << end_color() <<
"\n";
void print_errors_footer() override
Print footer after errors.
void print_global_header() override
Print global header.
void print_list_tests(const std::vector< TestInfo > &infos) override
Print the list of all the tests.
void print_errors_header() override
Print header before errors.
const Measurement & min() const
The measurement with the minimum value.
Copyright (c) 2017-2021 Arm Limited.
std::string name
Test name.
const Measurement & median() const
The median measurement.
void print_global_footer() override
Print global footer.
const Measurement::Value & mean() const
The average of all the measurements.
Information about a test case.
std::map< std::string, std::vector< Measurement > > MeasurementsMap
Mapping from instrument ids to their measurements.
Generate common statistics for a set of measurements.
void print_error(const std::exception &error, bool expected) override
Print test error.
void print_run_header() override
Print header before running all tests.
void print_run_footer() override
Print footer after running all tests.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
void print_entry(const std::string &name, const std::string &value) override
Print an entry consisting of a (name, value) pair.
void print_test_footer() override
Print footer after a test.
double relative_standard_deviation() const
The relative standard deviation of the measurements.
void set_color_output(bool color_output)
Set if the output is colored.
const Value & value() const
Accessor for the stored value.
void print_measurements(const Profiler::MeasurementsMap &measurements) override
Print measurements for a test.
const std::string & unit() const
Accessor for the unit of the measurement.
std::string arithmetic_to_string(T val, int decimal_places=0)
Create a string with the arithmetic value in full precision.
void print_info(const std::string &info) override
Print test log info.
void print_test_header(const TestInfo &info) override
Print header before a test.
const Measurement & max() const
The measurement with the maximum value.