This patch begins a set of changes to convert the library to use JSON as
the primary data type used to communicate with users; but for custom user
input and output.
The patch introduces the json.hpp header which is supplied by
https://github.com/nlohmann/json. The header is used unmodified
in the third_party directory. It is installed under the include/benchmark
prefix.
Additionally, this patch adds `Benchmark::WithInput` to allow
the passing of arbitrary JSON as an input argument to a benchmark.
The results of which can be accessed using `State::GetInput()`.
This patch also adds `State::operator[](std::string)`, which allows
users to report arbitrary JSON as output from a benchmark. See
the documentation for examples.
* Add support for GTest based unit tests.
As Dominic and I have previously discussed, there is some
need/desire to improve the testing situation in Google Benchmark.
One step to fixing this problem is to make it easier to write
unit tests by adding support for GTest, which is what this patch does.
By default it looks for an installed version of GTest. However the
user can specify -DBENCHMARK_BUILD_EXTERNAL_GTEST=ON to instead
download, build, and use copy of gtest from source. This is
quite useful when Benchmark is being built in non-standard configurations,
such as against libc++ or in 32 bit mode.
* 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
This patch adds new builders that test against GCC 6 and Clang 3.8 respectivly.
They also enable both address and undefined sanitizer. MSAN currently won't work
since it requires a sanitized STL.
Google Benchmark's Travis build currently requires "sudo" to install newer
versions of CMake and similar. See this for more details:
https://docs.travis-ci.com/user/workers/container-based-infrastructure/
Since Google Benchmark was put into Travis before 2015-01-01, it gets the
standard infrastructure implicitly, so sudo works. But anyone who forks this
repository and tries to add Travis.CI (so they can see if the build works
before creating a PR) gets broken builds before this change.
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.