Remove custom testing and benchmarking code.

Snappy includes a testing framework, which implements a subset of the
Google Test API, and can be used when Google Test is not available.
Snappy also includes a micro-benchmark framework, which implements an
old version of the Google Benchmark API.

This CL replaces the custom test and micro-benchmark frameworks with
google/googletest and google/benchmark. The code is vendored in
third_party/ via git submodules. The setup is similar to google/crc32c
and google/leveldb.

This CL also updates the benchmarking code to the modern Google
Benchmark API.

Benchmark results are expected to be more precise, as the old framework
ran each benchmark with a fixed number of iterations, whereas Google
Benchmark keeps iterating until the noise is low.

PiperOrigin-RevId: 347456142
This commit is contained in:
Victor Costan
2020-12-14 21:26:01 +00:00
parent 11f9a77a2f
commit 549685a598
7 changed files with 154 additions and 433 deletions

View File

@@ -70,6 +70,7 @@ You need the CMake version specified in [CMakeLists.txt](./CMakeLists.txt)
or later to build:
```bash
git submodule update --init
mkdir build
cd build && cmake ../ && make
```
@@ -114,14 +115,10 @@ but it contains several useful components for Snappy development.
First of all, it contains unit tests, verifying correctness on your machine in
various scenarios. If you want to change or optimize Snappy, please run the
tests to verify you have not broken anything. Note that if you have the
Google Test library installed, unit test behavior (especially failures) will be
significantly more user-friendly. You can find Google Test at
tests to verify you have not broken anything.
https://github.com/google/googletest
You probably also want the gflags library for handling of command-line flags;
you can find it at
The gflags library for handling of command-line flags is used if it's installed.
You can find it at
https://gflags.github.io/gflags/
@@ -145,5 +142,5 @@ test.)
Contact
=======
Snappy is distributed through GitHub. For the latest version, a bug tracker,
and other information, see https://github.com/google/snappy.
Snappy is distributed through GitHub. For the latest version and other
information, see https://github.com/google/snappy.