Commit Graph

797 Commits

Author SHA1 Message Date
Eric 83ac086fbd Add compare_bench.py documentation. Fixes #309 (#318) 2016-12-02 19:47:27 -07:00
Eric Fiselier a8aa40c596 Fix obvious typo in string formatting 2016-11-19 05:17:52 -07:00
Eric Fiselier 2373382284 Rewrite compare_bench.py argument parsing.
This patch cleans up a number of issues with how compare_bench.py handled
the command line arguments.

* Use the 'argparse' python module instead of hand rolled parsing. This gives
  better usage messages.

* Add diagnostics for certain --benchmark flags that cannot or should not
  be used with compare_bench.py (eg --benchmark_out_format=csv).

* Don't override the user specified --benchmark_out flag if it's provided.

In future I would like the user to be able to capture both benchmark output
files, but this change is big enough for now.

This fixes issue #313.
2016-11-18 15:42:02 -07:00
Dominic Hamon 4f8bfeae47 Report error when no benchmarks match regex. (#308)
Fixes #306
2016-10-28 14:22:22 -07: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
Dominic Hamon 8e08aa75d9 Merge branch 'mkurdej-arg-names' 2016-10-26 09:22:18 -07:00
Marek Kurdej 3f23832a09 Allow calling Args and ArgNames in any order. 2016-10-26 09:36:39 +02:00
Marek Kurdej cfee1a54e4 Check argument count in `ArgName` and `ArgNames`. 2016-10-26 09:29:28 +02:00
Marek Kurdej c1c01b2cd3 Handle the case when the argument name is an empty string. 2016-10-25 09:45:35 +02:00
Marek Kurdej 17e1c405dd Add ArgName() and ArgNames() methods to name arguments/ranges. 2016-10-24 09:57:40 +02:00
Dominic Hamon 44c25c892a Merge branch 'mkurdej-fix-time-unit' 2016-10-21 09:24:46 -07:00
Marek Kurdej 8aeb20f16b Add tests. 2016-10-21 14:59:06 +02:00
Marek Kurdej 5aa3855627 Fix displayed time unit in mean and standard deviation. 2016-10-21 14:33:23 +02:00
Eric Fiselier 57a22c69b3 Fix typo in timer.cc that caused negative CPU times on OS X. Fixes #293 2016-10-08 02:12:40 -06:00
Eric Fiselier 721c9224b9 Fix getting the CPU frequency on OS X 2016-10-08 01:38:09 -06:00
Eric Fiselier f67ee4ad9b Fix #294. Add -D_GNU_SOURCE when building under Cygwin 2016-10-08 01:03:23 -06:00
Eric Fiselier 03c4485d84 Fix #295. Remove use of BSD extensions for comparing strings 2016-10-07 22:54:06 -06:00
Eric Fiselier 36a251ab3e Fix #300. Emit RMS as a float not a percentage in JSON 2016-10-07 22:26:01 -06: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 332f677b8b Apply clang-format to all headers and source (#303) 2016-10-07 11:35:03 -07:00
Dominic Hamon 1100e91907 Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
ktnyt d1daeee4e9 Pass flag string to `check_cxx_compiler_flag` (#298) 2016-10-05 09:19:14 -07:00
Eric Fiselier 2aca242bf6 Fix various uninitialized members 2016-09-28 18:21:36 -06:00
Alt 6cadcf7f14 Fix working on mac clock_gettime (#292)
* fix working on mac clock_gettime

* Comment fixme
2016-09-26 15:48:25 -07:00
Dominic Hamon 62c68ba4f0 s/resolved/unresolved/ 2016-09-23 12:44:22 -07:00
Nicholas Hutchinson 917b86e615 Auto-detect whether Benchmark should produce colorized output (#126)
* Auto-detect whether to produce colorized output

Rename --color_print to --benchmark_color for consistency with the other
flags (and Google Test). Old flag name is kept around for compatibility.

The --benchmark_color/--color_print flag takes a third option, "auto",
which is the new default. In this mode, we attempt to auto-detect
whether to produce colorized output. (The logic for deciding whether to
use colorized output was lifted from GTest:
<https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L2925>.)

* Update CONTRIBUTORS, AUTHORS
2016-09-15 15:10:35 -06:00
Nicholas Hutchinson b826143ac2 Flush reporters' output streams after writing a benchmark run (#288)
If a reporter's output stream isn't line-buffered (e.g. it's not writing
to a terminal) then it can be some time before a write to it becomes
visible.

This is problematic if, say, you're wanting to use tail -f to view the
file written to via --benchmark_out. Or if the application crashes,
leaving you with no results.

Addressed by flushing the reporters' output streams whenever we invoke
methods that may write to them.
2016-09-11 15:36:14 -06:00
Eric c6f3f0eb9c Cleanup RunBenchmark code. (#289)
* Cleanup the code for generating and running benchmarks

* Rework calculation of real/manual time

* Add back TSAN builder
2016-09-06 02:28:35 -06:00
Eric d038472c18 Refactor benchmark.cc into benchmark_register.cc and benchmark.cc (#287)
* Refactor benchmark.cc into benchmark_register.cc and benchmark_run.cc

The benchmark.cc file is getting really big and it contains a bunch of
unrelated components. This patch separates the files into two separate
parts. The "runtime" parts and the "registration" parts.

This patch also removes the PIMPL used by Benchmark. Previously we couldn't
have STL types in the interface but now we can. Therefore there is no reason
to keep BenchmarkImp.

* add missing include

* rework windows timers again

* Guard timespec on older Windows versions

* Remove old thread safety annotation workarounds
2016-09-05 15:48:40 -06:00
Eric Fiselier 9c26168126 Document --benchmark_filter. Thanks to NAThompson for the original patch 2016-09-05 15:40:12 -06:00
Ronny 72be9523bb Add Benchmark::ThreadRange() version with increment instead of multiply (#283)
* add additive thread range

* add test
2016-09-03 13:56:46 -06:00
Eric Fiselier 60e88c21e4 Remove TSAN builder for now. 2016-09-03 02:11:42 -06:00
Eric Fiselier db376c8654 Tweak TSAN flags 2016-09-03 01:45:59 -06:00
Eric Fiselier 183999c002 Add Thread Sanitizer bot to Travis 2016-09-03 00:40:44 -06:00
Eric Fiselier 07ee194092 Fix wording because an idiot came up with it. 2016-09-03 00:19:37 -06:00
Eric Fiselier 309ecb737f Increase complexity_test runtime slightly less. 2016-09-03 00:18:02 -06:00
Eric Fiselier f261c68074 Try and add MSVC NORETURN attribute again 2016-09-03 00:13:20 -06:00
Eric Fiselier 756f069918 Increase complexity_test.cc runtime to attempt to avoid appveyor failures 2016-09-03 00:06:51 -06:00
Eric Fiselier 2314368cb5 Add another workaround for Appveyor warnings 2016-09-02 23:59:07 -06:00
Eric Fiselier 5224b63c35 Fix BENCHMARK_NORETURN on MSVC 2016-09-02 23:54:58 -06:00
Eric Fiselier a85f2a8e5b attempt to suppress apveyor warnings 2016-09-02 23:48:17 -06:00
Eric cba945e37d Make `PauseTiming()` and `ResumeTiming()` per thread. (#286)
* Change to using per-thread timers

* fix bad assertions

* fix copy paste error on windows

* Fix thread safety annotations

* Make null-log thread safe

* remove remaining globals

* use chrono for walltime since it is thread safe

* consolidate timer functions

* Add missing ctime include

* Rename to be consistent with Google style

* Format patch using clang-format

* cleanup -Wthread-safety configuration

* Don't trust _POSIX_FEATURE macros because OS X lies.

* Fix OS X thread timings

* attempt to fix mingw build

* Attempt to make mingw work again

* Revert old mingw workaround

* improve diagnostics

* Drastically improve OS X measurements

* Use average real time instead of max
2016-09-02 21:34:34 -06:00
Dominic Hamon 94c2a30a3e Add clang-format file 2016-09-02 14:49:59 -07:00
biojppm 6a28f1e968 Fixture: add non const Setup() and TearDown(). (#285)
* Fixture: add non const Setup() and TearDown().

This allows write-access to the State variable, which is important in
upcoming user-defined counter functionality.

* Fix const placement in the Fixture methods.

* Fixture: use const_cast instead of static_cast.
2016-09-01 10:51:48 -07:00
biojppm 83561f0580 CMake: add headers to the list of source files. (#284)
cmake does not require this, but IDEs such as VisualStudio or QtCreator
need this to add the headers to the generated project.
2016-08-31 15:28:43 -07:00
Eric Fiselier 61f570e82a Fix #202 - Document Windows dependency on shlwapi.lib 2016-08-30 03:41:58 -06:00
Eric df7bd92afd Add warning for large benchmark families (#279)
* Add warning for large benchmark families

* reflow comment
2016-08-29 12:43:55 -06:00
Eric 6e25917001 Add -DBENCHMARK_USE_LIBCXX:BOOL=<value> option. (#280)
* Add BENCHMARK_USE_LIBCXX option.

* Add comments

* re-add zero null pointer warning
2016-08-29 12:43:30 -06:00
Eric 49bbff2c66 Supply old `RangePair` and `ArgPair` API for C++03 compatibility. (#278)
* changes

* remove other changes

* remove unneeded test

* cleanup unused include
2016-08-29 10:59:46 -07:00
Eric Fiselier 2e0796e148 Cleanup and optimize Range generation. 2016-08-28 23:15:55 -06:00