Commit Graph

28 Commits

Author SHA1 Message Date
Roman Lebedev b123abdcf4 Add Iteration-related Counter::Flags. Fixes #618 (#621)
Inspired by these [two](a1ebe07bea) [bugs](0891555be5) in my code due to the lack of those i have found fixed in my code:
* `kIsIterationInvariant` - `* state.iterations()`
  The value is constant for every iteration, and needs to be **multiplied** by the iteration count.
* `kAvgIterations` - `/ state.iterations()`
  The is global over all the iterations, and needs to be **divided** by the iteration count.

They play nice with `kIsRate`:
* `kIsIterationInvariantRate`
* `kAvgIterationsRate`.

I'm not sure how  meaningful they are when combined with `kAvgThreads`.
I guess the `kIsThreadInvariant` can be added, too, for symmetry with `kAvgThreads`.
2018-06-27 15:45:30 +01:00
BaaMeow 4c2af07889 (clang-)format all the things (#610)
* format all documents according to contributor guidelines and specifications
use clang-format on/off to stop formatting when it makes excessively poor decisions

* format all tests as well, and mark blocks which change too much
2018-06-01 11:14:19 +01:00
Eric Fiselier dd8dcc8da1 Make output tests more stable on slow machines.
The appveyor bot sometimes fails because the time it
outputs is 6 digits long, but the output test regex expects at most
5 digits. This patch increases the size to 6 digits to placate the
test. This should not *really* affect the correctness of the test.
2018-02-12 19:07:19 -07:00
Joao Paulo Magalhaes ec6f03579e Trying again to fix error caused by -Wunused-function.
This thing with the pragma ignore was getting out of hand: now
MinGW (and probably GCC) was erroring too. So I chose to move
the definition of IsZero() out of the anonymous namespace into
benchmark.cc.
2017-05-03 00:05:15 +01:00
Joao Paulo Magalhaes 1735413188 Fix pragma clang ignore with gcc. 2017-05-02 23:35:46 +01:00
Joao Paulo Magalhaes 160770fd08 Fix dropped-style elses. 2017-05-02 23:30:36 +01:00
Joao Paulo Magalhaes a31088632a Fix (that is, ignore) clang compile error. 2017-05-02 23:25:22 +01:00
Joao Paulo Magalhaes 17a012d754 Fix: --benchmark_counters_tabular was not being passed to tests. 2017-05-02 20:31:54 +01:00
Joao Paulo Magalhaes b57b2cfd77 Improve some comments. 2017-05-01 23:02:35 +01:00
Joao Paulo Magalhaes 64b5f3ff2d Make Results::GetTime() receive an enum. 2017-05-01 23:02:23 +01:00
Joao Paulo Magalhaes 3443ac2103 Fix brace formatting (Habits die hard!). 2017-05-01 23:02:11 +01:00
Joao Paulo Magalhaes cdbcaaf2b6 Fix g++-4.8 compile errors. 2017-04-29 20:47:32 +01:00
Joao Paulo Magalhaes 55876610f1 Remove unused prototype. 2017-04-29 20:02:19 +01:00
Joao Paulo Magalhaes 180719d0d6 Rename ResultsCheckerEntry to Results. 2017-04-29 20:01:18 +01:00
Joao Paulo Magalhaes f3b82a8eda Adopt standard style. 2017-04-29 19:44:13 +01:00
Joao Paulo Magalhaes 86249c57a5 Result checking: move some function definitions to source file. 2017-04-29 19:40:39 +01:00
Joao Paulo Magalhaes 92034a8b84 Make result checkers execute on all regex-matching benchmarks. 2017-04-29 19:02:07 +01:00
Joao Paulo Magalhaes 738fcd9e6a Add log of the benchmark name when checking results. 2017-04-29 18:30:28 +01:00
Joao Paulo Magalhaes 6452883027 Unit testing: add facilities to check benchmark results.
This is needed for examining the values of user counters (needed
for #348). It is also needed for checking the values of standard
benchmark results like items_processed or complexities (for example,
checking the standard deviation is needed for unit testing #357
as discussed in #362).
2017-04-28 15:02:27 +01:00
Joao Paulo Magalhaes 3c2d7f5348 User counter tests: first version. 2017-04-27 19:25:20 +01:00
Joao Paulo Magalhaes b273d9b7d5 Reporter tests: reuse csv header. 2017-04-27 19:24:06 +01:00
rolandschulz 9b92ed76a8 Fix ICC compiler warnings (#358)
fixes #354

The build fails with ICC17 because of warnings and Werror. What is the correct solution to fix it?
Should a patch

disable Werror for ICC (or maybe all non known compilers)
disable the false postive warnings for all files. This could be done using:
add_cxx_compiler_flag(-wd2102) #ICC17u2: Many false positives for Wstrict-aliasing
add_cxx_compiler_flag(-wd2259) #ICC17u2: non-pointer conversion from "long" to "int" may lose significant bits (even for explicit static cast, sleep.cc(44))
add_cxx_compiler_flag(-wd654) #ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden (because of deprecated overload)
disable warnings at file level or some other granularity
2017-03-27 18:30:54 -06:00
Marek Kurdej 0064c56abd Add tests for reporters (#307)
* Test bytes_per_second and items_per_second.

* Test SetLabel.

* Reformat.

* Make State::error_occurred_ private.

* Fix tests with floats.

* Merge private blocks
2016-10-28 09:13:57 -07:00
Marek Kurdej 8aeb20f16b Add tests. 2016-10-21 14:59:06 +02:00
Eric Fiselier 2555035f44 Use correct RE for floating point numbers in reporter_output_test.cc 2016-10-07 21:56:22 -06:00
Dominic Hamon 1100e91907 Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
Eric Fiselier aaa25ac376 Improve diagnostic output for output tests. 2016-08-28 14:22:11 -06:00
Eric 0ed4456097 Refactor output test runner into standalone module. (#277)
* refactor

* Move default substitutions into library

* Move default substitutions to the *right* place in the library

* Fix init order issues that caused test failures

* improve diagnostics

* add missing include

* general cleanup

* Address review comments
2016-08-28 13:24:16 -06:00