Skip to content

Commit

Permalink
Check for perf binary in BenchmarkTest
Browse files Browse the repository at this point in the history
Summary: SKIP() the test if perf isn't installed on the testing system.

Reviewed By: Gownta

Differential Revision: D67119693

fbshipit-source-id: a48bd16f25205922ad1b40bd69fa325db5fdb26d
  • Loading branch information
ckwalsh authored and facebook-github-bot committed Dec 12, 2024
1 parent 9a76788 commit b631701
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions third-party/folly/src/folly/test/BenchmarkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
#include <folly/portability/GFlags.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
#include <folly/test/TestUtils.h>

#include <algorithm>
#include <filesystem>

namespace folly {
namespace detail {
Expand Down Expand Up @@ -243,6 +245,7 @@ TEST_F(BenchmarkingStateTest, PerfSkipsAnIteration) {

#if FOLLY_PERF_IS_SUPPORTED
TEST_F(BenchmarkingStateTest, PerfIntegration) {
SKIP_IF(!std::filesystem::exists(kPerfBinaryPath)) << "Missing perf binary";
std::vector<int> in(1000, 0);

state.addBenchmark(__FILE__, "a", [&](unsigned n) {
Expand Down

0 comments on commit b631701

Please sign in to comment.