Commit Graph

129 Commits

Author SHA1 Message Date
Eric Fiselier 7a767012f1 Adopt new benchmark timing internals.
This patch adopts a new internal structure for how timings are performed.
Currently every iteration of a benchmark checks to see if it has been running
for an appropriate amount of time. Checking the clock introduces noise into
the timings and this can cause inconsistent output from each benchmark.

Now every iteration of a benchmark only checks an iteration count to see if it
should stop running. The iteration count is determined before hand by testing
the benchmark on a series of increasing iteration counts until a suitable count
is found. This increases the amount of time it takes to run the actual benchmarks
but it also greatly increases the accuracy of the results.

This patch introduces some breaking changes. The notable breaking changes are:
1. Benchmarks run on multiple threads no generate a report per thread. Instead
   only a single report is generated.
2. ::benchmark::UseRealTime() was removed and replaced with State::UseRealTime().
2015-03-12 18:03:33 -04:00
Eric Fiselier 5b41e128b3 Step one towards merging timer changes.
This patch cleans up our use of generic macros and also merges changes in the
build system.

It adds options -DBENCHMARK_ENABLE_TESTING and -DBENCHMARK_ENABLE_SHARED.
2015-03-06 12:35:00 -05:00
Pavel Davydov 26c01ee9ab Fix #77 add FreeBSD detection in cmake 2015-02-21 17:23:20 +03:00
Eric Fiselier 114886100b Don't use c++14 2015-02-19 16:38:30 -05:00
Niklas Hofmann 27aa01a3f9 remove -Wzero-as-null-pointer-constant flag for now 2014-10-26 03:23:15 +01:00
Chris Kennelly 8eac5dc328 Merge pull request #58 from google/zero_null
Fix #50 by using nullptr and adding stricter warning.
2014-10-18 15:33:40 -07:00
Dominic Hamon e6107a781c Fix #50 by using nullptr and adding stricter warning. 2014-10-11 15:52:50 -07:00
Dominic Hamon a13627bc3a Move pthread dependency to test CMakeLists.txt 2014-10-11 14:57:45 -07:00
Matt Clarkson edfa60a1d1 Resolve regular expression engines 2014-08-22 14:55:46 +01:00
Matt Clarkson fac16a662e CMakeLists.txt comments 2014-08-20 08:42:30 +01:00
Matt Clarkson 1c82191d7a Consistent indentation in CMakeLists.txt 2014-08-20 08:42:29 +01:00
Matt Clarkson 6a66991586 Verify gtest with URL_MD5 2014-08-08 13:46:04 +01:00
Dominic Hamon ed08661efe Remove URL_HASH as it is unsupported 2014-08-07 10:28:55 -07:00
Matt Clarkson d2aa5c1eb3 Verify the download of gtest 2014-08-07 17:58:30 +01:00
Matt Clarkson 6b1a6958c4 CMake function for adding compiler flags 2014-08-04 10:01:44 +01:00
Matt Clarkson 6945096ba1 Add -Wshadow if supported 2014-08-04 10:01:44 +01:00
Matt Clarkson e863292dcc Detect compiler flags and append to default CMake flags 2014-08-04 10:01:44 +01:00
Matt Clarkson c927845d5a get_git_version CMake function 2014-08-01 15:02:32 +01:00
Matt Clarkson d591edf513 Implemented git versioning
This patch automatically versions the shared libraries from any annotated `git`
tags:

```
git tag -a v1.0.0
```

It expects semver version tags such as `v1.0.0`. It would be trivial to support
`1.0.0` but looking around it seems that most C/C++ projects follow `vX.X.X`
rather that `X.X.X` like a lot of `Node.js` stuff.

This determines that the if the project has had a certain amount of commits
since the last tag and also if the project is _dirty_ (has modified files), but
does __nothing__ with that information. In the future a more robust release
could be implemented in the script.

This is pretty brittle and has little in the way of configuration. Ideally we
should use `find_program` to work out where `git` is so that users can configure
it. This implementation assumes that `git` will be available in `PATH`

Outputs the following on the command line:

```
-- git Version: v[MAJOR].[MINOR].[PATCH]-[COMMITS_SINCE_TAG]-[SHA1](-dirty)?
-- Version: [MAJOR].[MINOR].[PATCH]
```
2014-08-01 09:20:28 +01:00
Matt Clarkson 57fdf38f74 Allow shared libraries with BUILD_SHARED_LIBS 2014-07-30 18:08:54 +01:00
Lei Xu 3460bf1aa6 Fixed compiling on Mac 10.9.3 with g++-4.8, clang or system c++ 2014-07-24 23:57:09 -07:00
Chris Kennelly 92cd2e82af Remove URL_HASH and TLS_VERIFY from CMake configuration.
Per the CMake 2.8.0 documentation, these options did not exist for
ExternalProject_Add.  These options were added in CMake 2.8.10.
2014-04-23 14:23:20 -07:00
Chris Kennelly 6087edda9d Add ExternalProject reference to Google Test 1.7.0. 2014-04-23 00:55:36 -07:00
Chris Kennelly e38fde6450 Setup targets from each directory, rather than the top-level. 2014-04-23 00:47:07 -07:00
David Coeurjolly 22f436ea84 Missing includes in install target 2014-02-05 21:07:40 +01:00
David Coeurjolly cbcf159bf2 Thread is required 2014-02-05 20:46:54 +01:00
David Coeurjolly 25074512ff Cmake edit with 'make install' target 2014-02-05 20:38:57 +01:00
Dominic Hamon 77cd9803ce add pedantic errors and fix them 2014-01-10 15:07:04 -08:00
Dominic Hamon 403f354423 Initial commit
Benchmark library builds and runs but only single-threaded. Multithreaded
support needs a bit more love.

Currently requires some C++11 support (g++ 4.6.3 seems to work).
2013-12-18 16:58:23 -08:00