Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 923407e

Browse files
committed
Update googlebenchmark to v1.8.0
1 parent 08540f9 commit 923407e

File tree

171 files changed

+16390
-3146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+16390
-3146
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
Checks: 'clang-analyzer-*,readability-redundant-*,performance-*'
3+
WarningsAsErrors: 'clang-analyzer-*,readability-redundant-*,performance-*'
4+
HeaderFilterRegex: '.*'
5+
AnalyzeTemporaryDtors: false
6+
FormatStyle: none
7+
User: user
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**System**
14+
Which OS, compiler, and compiler version are you using:
15+
- OS:
16+
- Compiler and version:
17+
18+
**To reproduce**
19+
Steps to reproduce the behavior:
20+
1. sync to commit ...
21+
2. cmake/bazel...
22+
3. make ...
23+
4. See error
24+
25+
**Expected behavior**
26+
A clear and concise description of what you expected to happen.
27+
28+
**Screenshots**
29+
If applicable, add screenshots to help explain your problem.
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FR]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if ! bazel version; then
2+
arch=$(uname -m)
3+
if [ "$arch" == "aarch64" ]; then
4+
arch="arm64"
5+
fi
6+
echo "Installing wget and downloading $arch Bazel binary from GitHub releases."
7+
yum install -y wget
8+
wget "https://github.com/bazelbuild/bazel/releases/download/6.0.0/bazel-6.0.0-linux-$arch" -O /usr/local/bin/bazel
9+
chmod +x /usr/local/bin/bazel
10+
else
11+
# bazel is installed for the correct architecture
12+
exit 0
13+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# Checkout LLVM sources
6+
git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project
7+
8+
## Setup libc++ options
9+
if [ -z "$BUILD_32_BITS" ]; then
10+
export BUILD_32_BITS=OFF && echo disabling 32 bit build
11+
fi
12+
13+
## Build and install libc++ (Use unstable ABI for better sanitizer coverage)
14+
mkdir llvm-build && cd llvm-build
15+
cmake -DCMAKE_C_COMPILER=${CC} \
16+
-DCMAKE_CXX_COMPILER=${CXX} \
17+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
18+
-DCMAKE_INSTALL_PREFIX=/usr \
19+
-DLIBCXX_ABI_UNSTABLE=OFF \
20+
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
21+
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
22+
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \
23+
-G "Unix Makefiles" \
24+
../llvm-project/runtimes/
25+
make -j cxx cxxabi unwind
26+
cd ..
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: bazel
2+
3+
on:
4+
push: {}
5+
pull_request: {}
6+
7+
jobs:
8+
job:
9+
name: bazel.${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-2022]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: mount bazel cache
20+
uses: actions/cache@v3
21+
env:
22+
cache-name: bazel-cache
23+
with:
24+
path: "~/.cache/bazel"
25+
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.ref }}
26+
restore-keys: |
27+
${{ env.cache-name }}-${{ matrix.os }}-main
28+
29+
- name: build
30+
run: |
31+
bazel build //:benchmark //:benchmark_main //test/...
32+
33+
- name: test
34+
run: |
35+
bazel test --test_output=all //test/...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build-and-test-min-cmake
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
job:
11+
name: ${{ matrix.os }}.min-cmake
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: lukka/get-cmake@latest
22+
with:
23+
cmakeVersion: 3.10.0
24+
25+
- name: create build environment
26+
run: cmake -E make_directory ${{ runner.workspace }}/_build
27+
28+
- name: setup cmake initial cache
29+
run: touch compiler-cache.cmake
30+
31+
- name: configure cmake
32+
env:
33+
CXX: ${{ matrix.compiler }}
34+
shell: bash
35+
working-directory: ${{ runner.workspace }}/_build
36+
run: >
37+
cmake -C ${{ github.workspace }}/compiler-cache.cmake
38+
$GITHUB_WORKSPACE
39+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
40+
-DCMAKE_CXX_VISIBILITY_PRESET=hidden
41+
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON
42+
43+
- name: build
44+
shell: bash
45+
working-directory: ${{ runner.workspace }}/_build
46+
run: cmake --build .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: build-and-test-perfcounters
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
job:
11+
# TODO(dominic): Extend this to include compiler and set through env: CC/CXX.
12+
name: ${{ matrix.os }}.${{ matrix.build_type }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-22.04, ubuntu-20.04]
18+
build_type: ['Release', 'Debug']
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: install libpfm
23+
run: |
24+
sudo apt update
25+
sudo apt -y install libpfm4-dev
26+
27+
- name: create build environment
28+
run: cmake -E make_directory ${{ runner.workspace }}/_build
29+
30+
- name: configure cmake
31+
shell: bash
32+
working-directory: ${{ runner.workspace }}/_build
33+
run: >
34+
cmake $GITHUB_WORKSPACE
35+
-DBENCHMARK_ENABLE_LIBPFM=1
36+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
37+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
38+
39+
- name: build
40+
shell: bash
41+
working-directory: ${{ runner.workspace }}/_build
42+
run: cmake --build . --config ${{ matrix.build_type }}
43+
44+
# Skip testing, for now. It seems perf_event_open does not succeed on the
45+
# hosting machine, very likely a permissions issue.
46+
# TODO(mtrofin): Enable test.
47+
# - name: test
48+
# shell: bash
49+
# working-directory: ${{ runner.workspace }}/_build
50+
# run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: build-and-test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
# TODO: add 32-bit builds (g++ and clang++) for ubuntu
11+
# (requires g++-multilib and libc6:i386)
12+
# TODO: add coverage build (requires lcov)
13+
# TODO: add clang + libc++ builds for ubuntu
14+
job:
15+
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.compiler }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-22.04, ubuntu-20.04, macos-latest]
21+
build_type: ['Release', 'Debug']
22+
compiler: ['g++', 'clang++']
23+
lib: ['shared', 'static']
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- uses: lukka/get-cmake@latest
29+
30+
- name: create build environment
31+
run: cmake -E make_directory ${{ runner.workspace }}/_build
32+
33+
- name: setup cmake initial cache
34+
run: touch compiler-cache.cmake
35+
36+
- name: configure cmake
37+
env:
38+
CXX: ${{ matrix.compiler }}
39+
shell: bash
40+
working-directory: ${{ runner.workspace }}/_build
41+
run: >
42+
cmake -C ${{ github.workspace }}/compiler-cache.cmake
43+
$GITHUB_WORKSPACE
44+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
45+
-DBUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
46+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
47+
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
48+
-DCMAKE_CXX_VISIBILITY_PRESET=hidden
49+
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON
50+
51+
- name: build
52+
shell: bash
53+
working-directory: ${{ runner.workspace }}/_build
54+
run: cmake --build . --config ${{ matrix.build_type }}
55+
56+
- name: test
57+
shell: bash
58+
working-directory: ${{ runner.workspace }}/_build
59+
run: ctest -C ${{ matrix.build_type }} -VV
60+
61+
msvc:
62+
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msvc }}
63+
runs-on: ${{ matrix.os }}
64+
defaults:
65+
run:
66+
shell: powershell
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
msvc:
71+
- VS-16-2019
72+
- VS-17-2022
73+
arch:
74+
- x64
75+
build_type:
76+
- Debug
77+
- Release
78+
lib:
79+
- shared
80+
- static
81+
include:
82+
- msvc: VS-16-2019
83+
os: windows-2019
84+
generator: 'Visual Studio 16 2019'
85+
- msvc: VS-17-2022
86+
os: windows-2022
87+
generator: 'Visual Studio 17 2022'
88+
89+
steps:
90+
- uses: actions/checkout@v2
91+
92+
- uses: lukka/get-cmake@latest
93+
94+
- name: configure cmake
95+
run: >
96+
cmake -S . -B _build/
97+
-A ${{ matrix.arch }}
98+
-G "${{ matrix.generator }}"
99+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
100+
-DBUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
101+
102+
- name: build
103+
run: cmake --build _build/ --config ${{ matrix.build_type }}
104+
105+
- name: setup test environment
106+
# Make sure gmock and benchmark DLLs can be found
107+
run: >
108+
echo "$((Get-Item .).FullName)/_build/bin/${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
109+
echo "$((Get-Item .).FullName)/_build/src/${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
110+
111+
- name: test
112+
run: ctest --test-dir _build/ -C ${{ matrix.build_type }} -VV
113+
114+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: clang-format-lint
2+
on:
3+
push: {}
4+
pull_request: {}
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: DoozyX/[email protected]
13+
with:
14+
source: './include/benchmark ./src ./test'
15+
extensions: 'h,cc'
16+
clangFormatVersion: 12
17+
style: Google

0 commit comments

Comments
 (0)