File tree Expand file tree Collapse file tree 7 files changed +86
-0
lines changed
Expand file tree Collapse file tree 7 files changed +86
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ build.ninja
4141install_manifest.txt
4242rules.ninja
4343
44+ # bazel output symlinks.
45+ bazel- *
46+
4447# out-of-source build top-level folders.
4548build /
4649_build /
Original file line number Diff line number Diff line change @@ -159,11 +159,20 @@ install:
159159 brew update;
160160 brew install gcc@7;
161161 fi
162+ - if [ "{TRAVIS_OS_NAME}" == "linux" ]; then
163+ wget https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-linux-x86_64.sh --output-document bazel-installer.sh;
164+ sudo bash bazel-installer.sh;
165+ fi
166+ - if [ "{TRAVIS_OS_NAME}" == "osx" ]; then
167+ curl -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-darwin-x86_64.sh;
168+ sudo bash bazel-installer.sh;
169+ fi
162170
163171script :
164172 - cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ..
165173 - make
166174 - ctest -C ${BUILD_TYPE} --output-on-failure
175+ - bazel test -c dbg --announce_rc --verbose_failures --test_output=errors --keep_going //...
167176
168177after_success :
169178 - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Radoslav Yovchev <radoslav.tm@gmail.com>
3838Roman Lebedev <lebedev.ri@gmail.com>
3939Shuo Chen <chenshuo@chenshuo.com>
4040Steinar H. Gunderson <sgunderson@bigfoot.com>
41+ Stripe, Inc.
4142Yixuan Qiu <yixuanq@gmail.com>
4243Yusuke Suzuki <utatane.tea@gmail.com>
4344Zbigniew Skowron <zbychs@gmail.com>
Original file line number Diff line number Diff line change 1+ licenses (["notice" ])
2+
3+ cc_library (
4+ name = "benchmark" ,
5+ srcs = glob ([
6+ "src/*.cc" ,
7+ "src/*.h" ,
8+ ]),
9+ hdrs = ["include/benchmark/benchmark.h" ],
10+ copts = ["-DHAVE_STD_REGEX" ],
11+ strip_include_prefix = "include" ,
12+ visibility = ["//visibility:public" ],
13+ )
14+
15+ cc_library (
16+ name = "benchmark_internal_headers" ,
17+ hdrs = glob (["src/*.h" ]),
18+ visibility = ["//test:__pkg__" ],
19+ )
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
3838Jern-Kuan Leong <jernkuan@gmail.com>
3939JianXiong Zhou <zhoujianxiong2@gmail.com>
4040Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
41+ John Millikin <jmillikin@stripe.com>
4142Jussi Knuuttila <jussi.knuuttila@gmail.com>
4243Kai Wolf <kai.wolf@gmail.com>
4344Kishan Kumar <kumar.kishan@outlook.com>
Original file line number Diff line number Diff line change 1+ load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
2+
3+ git_repository (
4+ name = "com_google_googletest" ,
5+ commit = "3f0cf6b62ad1eb50d8736538363d3580dd640c3e" , # HEAD
6+ remote = "https://github.com/google/googletest" ,
7+ )
Original file line number Diff line number Diff line change 1+ NEEDS_GTEST_MAIN = [
2+ "statistics_test.cc" ,
3+ ]
4+
5+ TEST_COPTS = [
6+ "-pedantic" ,
7+ "-pedantic-errors" ,
8+ "-std=c++11" ,
9+ "-DHAVE_STD_REGEX" ,
10+ ]
11+
12+ TEST_ARGS = ["--benchmark_min_time=0.01" ]
13+
14+ cc_library (
15+ name = "output_test_helper" ,
16+ testonly = 1 ,
17+ srcs = ["output_test_helper.cc" ],
18+ hdrs = ["output_test.h" ],
19+ copts = TEST_COPTS ,
20+ deps = [
21+ "//:benchmark" ,
22+ "//:benchmark_internal_headers" ,
23+ ],
24+ )
25+
26+ [cc_test (
27+ name = test_src [:- len (".cc" )],
28+ size = "small" ,
29+ srcs = [test_src ],
30+ args = TEST_ARGS + ({
31+ "user_counters_tabular_test.cc" : ["--benchmark_counters_tabular=true" ],
32+ }).get (test_src , []),
33+ copts = TEST_COPTS + ({
34+ "cxx03_test.cc" : ["-std=c++03" ],
35+ # Some of the issues with DoNotOptimize only occur when optimization is enabled
36+ "donotoptimize_test.cc" : ["-O3" ],
37+ }).get (test_src , []),
38+ deps = [
39+ ":output_test_helper" ,
40+ "//:benchmark" ,
41+ "//:benchmark_internal_headers" ,
42+ "@com_google_googletest//:gtest" ,
43+ ] + (
44+ ["@com_google_googletest//:gtest_main" ] if (test_src in NEEDS_GTEST_MAIN ) else []
45+ ),
46+ ) for test_src in glob (["*_test.cc" ])]
You can’t perform that action at this time.
0 commit comments