Commit graph

865 commits

Author SHA1 Message Date
Joao Paulo Magalhaes b5effb30f9 Add missing include for providing std::function. 2017-04-29 20:24:26 +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 03b0655d12 Fix expected values of user counters as rates in unit tests. 2017-04-29 19:35:43 +01:00
Joao Paulo Magalhaes 921a51abcf Console reporting of user counters: print rates like non-rates. 2017-04-29 19:34:37 +01:00
Joao Paulo Magalhaes 5ed1b1dea7 Merge branch 'master' of https://github.com/vladoovtcharov/benchmark into test_usercounters 2017-04-29 19:27:53 +01:00
Joao Paulo Magalhaes 78548f8c6e Add (currently failing) tests for user counters with threads. 2017-04-29 19:26:34 +01:00
Joao Paulo Magalhaes 2814e9d8dc Fix ResultsCheckerEntry::NumThreads() 2017-04-29 19:25:51 +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 1ce286f632 Avoid compiler-specific pragmas in result check macros.
- Epsilon is now understood as relative to expected value.
- Improve error messages for epsilon checks.
2017-04-29 18:26:30 +01:00
Joao Paulo Magalhaes da69e5de45 User counters: add more tests. 2017-04-28 20:45:30 +01:00
Joao Paulo Magalhaes 8c757a3bb9 Results check: add checks with epsilon. 2017-04-28 20:44:27 +01:00
Joao Paulo Magalhaes 1826feb164 ResultsCheckerEntry: add more getter functions. 2017-04-28 20:43:44 +01:00
Joao Paulo Magalhaes 2a8d0dd1b1 Use const char* instead of std::string in entry name lookup. 2017-04-28 20:42:28 +01:00
Joao Paulo Magalhaes 8adf59d762 Add epsilon check macros for float comparison. 2017-04-28 20:40:21 +01:00
Joao Paulo Magalhaes e869e3749a Remove some whitespace. 2017-04-28 15:38:21 +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 693a43013d User counters: add more unit tests. ...
The tests are still missing a way to check actual validity of
numerical results; this will be done next. As they currently are,
the tests pass, but the problem detected with #378 is still
standing and the results with non-standard counters are wrong.
2017-04-27 22:11:40 +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
Joao Paulo Magalhaes 409f35da50 User counters: fix misplaced newline in console reporter header. 2017-04-27 19:22:36 +01:00
vladoovt 1295ce8f23 Fixes #378 coercion to double was causing counter to forget its flags, changed it so that its value is updated directly 2017-04-27 09:56:43 -06:00
Joao Paulo Magalhaes 2d1a34626f Fixes #378 (hopefully). Unit tests for counters to follow.
The problem was that the call to Finish() the user counters was
lost in a big merge. If I had already written the tests for the
user counters, this would probably have been catched earlier.
2017-04-27 13:16:49 +01:00
Joao Paulo Magalhaes 27b3bd4dc4 Merge branch 'master' of https://github.com/google/benchmark 2017-04-27 12:38:28 +01:00
Arkady Shapkin 3336ea00d8 Support VS2017 on AppVeyor (#376) 2017-04-24 10:45:24 -07:00
Dmitry Trifonov 7a74b74856 fix for android NDK r10e (#375) 2017-04-20 20:07:52 -06:00
Dmitry Trifonov 09b93ccc6a fix android compilation (#372)
* fix android compilation

* checking __GLIBCXX__ and __GLIBCPP__ macro in addition to __ANDROID__

* using vsnprintf instead of std::vsnprintf to compile on Android

* removed __GLIBCPP__ check on Android

* StringPrintF instead of std::to_string for Android
2017-04-18 09:48:07 -06:00
Eric Fiselier 46afd8e693 Don't limit benchmarks with manual timers to 5x the elapsed real time.
When using CPU time to determine the correct number of iterations the
library additionally checks if the benchmark has consumed 5x the minimum
required time according to the wall clock. This prevents benchmarks
with low CPU usage from running for much longer than actually intended.

However when a benchmark uses a manual timer this heuristic isn't helpful
and likely isn't correct since we don't know what the manual timer actually
measures.

This patch removes the above restriction when a benchmark specifies a manual
timer.
2017-04-18 00:13:18 -06:00
Eric 74b24058ad Add Benchmark::Iterations for explicit iteration count control - Fixes #370 (#373)
* Add Benchmark::Iterations for explicitly specifying the number of iterations to use.

* Document that benchmark::Iterations should not be used to limit benchmark runtimes
2017-04-17 21:29:28 -07:00
Eric Fiselier 7f87c98d36 Enable <cassert> by removing -DNDEBUG when running the tests.
In non-debug builds CMake automatically adds -DNDEBUG, this means
that uses of `assert` in the tests are disabled for non-debug builds.
Obviously we want these tests to run, regardless of configuration.

This patch strips -DNDEBUG during non-debug builds and adds
-UNDEBUG just to be sure.
2017-04-17 20:53:39 -06:00
Daniel Varga 312d9d0ac5 Fix cmake file not to use CMAKE_SOURCE_DIR (#367)
Using CMAKE_SOURCE_DIR benchmark cannot be built as part of a project.
This change allows to add benchmark using add_subdirectory to a bigger
project.
2017-04-10 08:43:05 -07:00
Joao Paulo Magalhaes 9986589fff Merge branch 'master' of https://github.com/google/benchmark 2017-04-06 14:12:09 +01:00
jpmag 9a5072d1bf Fixes #357: broken RMS values when time unit is set. (#362) 2017-04-04 12:31:28 -07:00
Dominic Hamon 2fa6dfff32 Merge branch 'piribes-1.1' 2017-04-04 08:39:10 -07:00
Dominic Hamon 858581ea76 Remove unnecessary benchmark subfolder 2017-04-04 08:39:02 -07:00
Dominic Hamon 66283598e6 Merge branch '1.1' of git://github.com/piribes/benchmark into piribes-1.1 2017-04-04 08:35:51 -07:00
Giuseppe Roberti 128fe25025 Fix ${include_install_dir} 2017-04-04 02:13:20 +02:00
Giuseppe Roberti 824bbb818e Add CMake Package Config files during install
- Remove target_include_directories of ${PROJECT_SOURCE_DIR}/include to
  fix error: Target "benchmark" INTERFACE_INCLUDE_DIRECTORIES property
  contains path which is prefixed in the source directory.
2017-04-03 01:54:24 +02:00
Joao Paulo Magalhaes 707dd89344 User counters: document tabular output in README.md 2017-04-01 22:31:39 +01:00
Joao Paulo Magalhaes ea26e62a0d Fixes #357: broken RMS values when time unit is set. 2017-04-01 17:04:37 +01:00
Ray Glover 17298b2dc0 Python 2/3 compatibility (#361)
* [tools] python 2/3 support

* update authors/contributors
2017-03-29 03:39:18 -07:00
Eric 0dbcdf56a0 Add BENCHMARK_BUILD_32_BITS option and add builders to test it (#360)
* Add BENCHMARK_BUILD_32_BITS option and add builders to test it

* Attempt to fix travis configuration

* Make add_required_cxx_compiler_flag cause an error when the flag isn't supported

* add gcc-multilib dependancy on travis

* attempt to fix travis.yml parsing error

* Require g++-multilib instead of gcc-multilib

* Add 32 bit release configurations

* Attempt to fix libc++ travis build w/ 32 bits

* Work around CMake configuration failure on Travis
2017-03-28 00:43:42 -07:00
MVafin ec15860da5 Fix CPU frequency parsing on Linux (#355) (#356)
* Fix reading CPU info from file

Macro CHECK do nothing for release mode, meaning it doesn't invoke the
arguments

* Add myself to AUTHORS and CONTRIBUTORS
2017-03-28 00:35:17 -06:00
Eric 94c512c043 Replace int64_t usages with 'int' instead. (#359)
Previously the constants used for converting between
different units of time were declared using int64_t. However
we should only use explicitly sized integer types when they
are required, and should use 'int' everwhere else, and there is
no good reason to use int64_t here.

For that reason this patch changes the type of the constants.
This should help address issue #354 as well.
2017-03-27 18:32:12 -06: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
Yasushi Saito f5ff6d0e0d Include cstdlib for timespec. Clang modules demands that. (#353) 2017-03-13 20:30:19 -06:00
Eric f682f7e9a4 Implement ClobberMemory() and fix DoNotOptimize on MSVC. (#352)
I recently learned Windows provides a function called _ReadWriteBarrier
which is literally ClobberMemory under a different name. This patch
uses it to implement ClobberMemory under MSVC.
2017-03-10 18:47:39 -07:00