Commit Graph

18 Commits

Author SHA1 Message Date
SunBlack 37faf6f975
Fix Clang-Tidy warnings related to modernize-use-override (#1523) 2023-01-09 17:52:18 +00:00
Dominic Hamon 8d86026c67
Enable -Wconversion (#1390)
Requires some casts here and there, but nothing unreasonable.

Fixes #1268
2022-05-01 19:56:30 +01:00
Dominic Hamon c07a498924
format tests with clang-format (#1282) 2021-11-10 16:22:31 +00:00
Roman Lebedev 4c2e32f1d0
Introduce "family index" field into JSON output (#1164)
It may be useful for those wishing to further post-process JSON results,
but it is mainly geared towards better support for run interleaving,
where results from the same family may not be close-by in the JSON.

While we won't be able to do much about that for outputs,
the tools can and perhaps should reorder the results to that
at least in their output they are in proper order, not run order.

Note that this only counts the families that were filtered-in,
so if e.g. there were three families, and we filtered-out
the second one, the two families (which were first and third)
will have family indexes 0 and 1.
2021-06-02 18:06:45 +03:00
Guillaume Chatelet 7d0d9061d8
Support -Wsuggest-override (#1059)
* Support -Wsuggest-override

google/benchmark is C++11 compatible but doesn't use the `override` keyword.
Projects using google/benchmark with enabled `-Wsuggest-override` and `-Werror` will fail to compile.

* Add -Wsuggest-override cxx flag

* Revert unrelated formatting

* Revert unrelated formatting, take 2

* Revert unrelated formatting, take 3

* Disable -Wsuggest-override when compiling tests, gtest does not handle it yet

Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
2021-05-11 14:56:00 +03:00
Eric 25acf220a4 Refactor most usages of KeepRunning to use the perfered ranged-for. (#459)
Recently the library added a new ranged-for variant of the KeepRunning
loop that is much faster. For this reason it should be preferred in all
new code.

Because a library, its documentation, and its tests should all embody
the best practices of using the library, this patch changes all but a
few usages of KeepRunning() into for (auto _ : state).

The remaining usages in the tests and documentation persist only
to document and test behavior that is different between the two formulations.

Also note that because the range-for loop requires C++11, the KeepRunning
variant has not been deprecated at this time.
2017-10-17 12:17:02 -06:00
Dominic Hamon 1100e91907 Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
Eric Fiselier 9341d705a1 Change --benchmark_list_tests to respect the benchmark filter.
This behavior mirrors how GTest handles these two flags.
2016-05-24 00:42:11 -06:00
Eric Fiselier e0de8171c6 Change RunSpecifiedBenchmarks to return the number of benchmarks run. Fixes #145 2016-05-23 23:35:09 -06:00
Anton Danielsson 6abd53777b Use stringstream instead of atoi to avoid sign error.
The sane thing here would be to use std::stoul but this is not available in the android-ndk...
2015-10-09 08:47:36 +02:00
Anton Danielsson df0df4aba9 Fixed tests so they build on android.
- Added missing header to test/benchmark_test.cc
- Changed std::stoul to std::atol in test/filter_test.cc because of a
  limitation in the android-ndk (http://stackoverflow.com/questions/17950814/how-to-use-stdstoul-and-stdstoull-in-android)
2015-10-09 08:47:35 +02:00
Greg Miller 2463339d0b Updates Initialize() to work with an argv as 'char**' 2015-09-30 16:14:50 -04:00
Eric Fiselier e97a96f9e7 redo filter test 2015-03-31 00:05:02 -04:00
Eric Fiselier 20f1c0e2a8 Apply reporter interface changes. Make report methods non-const and add a Finalize method. 2015-03-17 16:16:36 -04:00
Eric Fiselier e45252e6f5 move ConsoleReporter out of internal namespace 2015-03-17 14:15:16 -04:00
Eric Fiselier efe591015d address review comments 2015-03-17 12:31:46 -04:00
Eric Fiselier 66bf7c8f71 add floating point comparison warnings 2015-03-12 20:27:29 -04:00
Dominic Hamon 3b40f0a7a3 Add filter test, remove re test, and googletest deps 2015-03-09 20:30:14 -07:00