Convience script to run benchmark
Summary: You need to provide the benchmark binary with a path to the captures. This is annoying and there is not a great way to do this in c++ that is cross-plat. So I just made this bash script to ease it. It can do buck and cmake. Reviewed By: NickGerleman Differential Revision: D53632438 fbshipit-source-id: 98b0ad52f91f2581e09f787da24f2ec2fff58bf4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e2ed3f031d
commit
cae7ef924a
5
.github/workflows/validate-cpp.yml
vendored
5
.github/workflows/validate-cpp.yml
vendored
@@ -66,13 +66,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
|
|
||||||
- name: Build benchmark
|
- name: Build and run benchmark
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
./build/benchmark ./captures
|
||||||
working-directory: benchmark
|
working-directory: benchmark
|
||||||
|
|
||||||
- name: Run benchmarklegacy
|
- name: Build and run benchmarklegacy
|
||||||
run: ./build/benchmarklegacy
|
run: ./build/benchmarklegacy
|
||||||
working-directory: benchmark
|
working-directory: benchmark
|
||||||
|
|
||||||
|
15
benchmark/benchmark
Executable file
15
benchmark/benchmark
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
cd "$(dirname "$0")" || exit
|
||||||
|
CAPTURES_PATH="$(dirname "$(realpath "$0")")""/captures"
|
||||||
|
|
||||||
|
if [ "$1" = "buck" ]; then
|
||||||
|
buck run @fbcode/mode/opt :benchmarkCXX "${CAPTURES_PATH}"
|
||||||
|
else
|
||||||
|
cmake -B build -S . -D CMAKE_BUILD_TYPE=Release
|
||||||
|
cmake --build build
|
||||||
|
build/benchmark "${CAPTURES_PATH}"
|
||||||
|
fi
|
Reference in New Issue
Block a user