Commit graph

26 commits

Author SHA1 Message Date
Dominic Hamon c8adf4531f
Add some 'travis_wait' commands to avoid gcc@7 installation timeouts. (#605) 2018-05-29 13:12:48 +01:00
Eric 7b03df7ff7
Add tests to verify assembler output -- Fix DoNotOptimize. (#530)
* Add tests to verify assembler output -- Fix DoNotOptimize.

For things like `DoNotOptimize`, `ClobberMemory`, and even `KeepRunning()`,
it is important exactly what assembly they generate. However, we currently
have no way to test this. Instead it must be manually validated every
time a change occurs -- including a change in compiler version.

This patch attempts to introduce a way to test the assembled output automatically.
It's mirrors how LLVM verifies compiler output, and it uses LLVM FileCheck to run
the tests in a similar way.

The tests function by generating the assembly for a test in CMake, and then
using FileCheck to verify the // CHECK lines in the source file are found
in the generated assembly.

Currently, the tests only run on 64-bit x86 systems under GCC and Clang,
and when FileCheck is found on the system.

Additionally, this patch tries to improve the code gen from DoNotOptimize.
This should probably be a separate change, but I needed something to test.

* Disable assembly tests on Bazel for now

* Link FIXME to github issue

* Fix Tests on OS X

* fix strip_asm.py to work on both Linux and OS X like targets
2018-03-23 16:10:47 -06:00
jmillikin-stripe a9beffda0b Add support for building with Bazel. (#533)
* Add myself to CONTRIBUTORS under the corp CLA for Stripe, Inc.

* Add support for building with Bazel.

Limitations compared to existing CMake rules:
* Defaults to using C++11 `<regex>`, with an override via Bazel flag
  `--define` of `google_benchmark.have_regex`. The TravisCI config sets
  the regex implementation to `posix` because it uses ancient compilers.
* Debug vs Opt mode can't be set per test. TravisCI runs all the tests
  in debug mode to satisfy `diagnostics_test`, which depends on `CHECK`
  being live.

* Set Bazel workspace name so other repos can refer to it by stable name.

This is recommended by the Bazel style guide to avoid each dependent
workspace defining its own name for the dependency.
2018-03-08 12:48:46 +00:00
Eric 37dbe80f9b
Attempt to fix travis timeouts during apt-get. (#528)
* Attempt to fix travis timeouts during apt-get.

During some builds, travis fails to update the apt-get indexes.
This causes the build to fail in different ways.

This patch attempts to avoid this issue by manually calling
apt-get update. I'm not sure if it'll work, but it's worth a try.

* Fix missing semicolons in command
2018-02-12 21:28:23 -07:00
Eric 7db02be244
Add support for GTest based unit tests. (#485)
* 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.
2017-12-13 16:26:47 -07:00
Dominic Hamon 7f2d2cd5b9 fix xcode travis builds by skipping mkdir errors 2017-12-07 14:20:59 -08:00
Victor Costan 0bbaeeaf7a Add GCC on OSX to list of Travis CI configurations. (#492) 2017-11-30 15:21:32 -08:00
Dominic Hamon febd0d7a7a Remove unnecessary whitespace in travis yaml 2017-05-22 09:27:28 -07:00
Tushar Maheshwari b1f33d44ea Add macOS builds to .travis.yml (#389) 2017-05-22 09:26:05 -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
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 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 85e7ed7eea Add libc++ and MSAN builders to to travis.
This patch adds three new build configurations to the travis CI.

* Clang 3.8 w/ libc++
* Clang 3.8 w/ libc++, UBSAN, ASAN
* Clang 3.8 w/ libc++, MSAN
2016-08-07 23:44:34 -06:00
Eric Fiselier 8267117a92 Add ASAN and UBSAN builders to travis for both GCC and Clang.
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.
2016-08-07 19:25:19 -06:00
Eric b7f8e355ee update travis, squash history (#265) 2016-08-02 14:47:29 -07:00
Billy Robert O'Neal III fa0e7ef8c6 Mark sudo: required for Travis
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.
2016-05-11 12:01:03 -07:00
Matt Clarkson ef47992125 Added coveralls support 2015-05-13 09:17:48 +01:00
Eric Fiselier 818c9fcc2f Upgrade travis to use CMake 2.8.12 and add Clang builders 2015-04-03 14:43:42 -04:00
Eric Fiselier bf063941d4 Print information about travis enviroment 2015-04-02 13:32:18 -04:00
Eric Fiselier e447887d16 Fix travis config by moving CTEST_OUTPUT_ON_FAILURE=1 into make test command 2015-03-09 14:40:08 -04:00
Eric Fiselier f7602badfb add env to make ctest print on failure 2015-03-09 14:34:32 -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
Evgeny Safronov 35c29c7d2f Added c++11 support for Travis. 2014-11-12 14:30:57 +04:00
Evgeny Safronov e4d41f8a23 Using Travis as CI. 2014-11-12 13:32:00 +04:00