Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31333: fuzz: Implement G_TEST_GET_FULL_NAME
Browse files Browse the repository at this point in the history
92d3d69 fuzz: Implement G_TEST_GET_FULL_NAME (Hodlinator)

Pull request description:

  Catching up to bench & unit tests. Makes for more orderly paths for fuzz tests using `BasicTestingSetup`.

  ### Before
  ```
  /tmp/test_common bitcoin/0748ae43ef8fa80703bc/regtest/blocks/xor.dat
  ```
  ### After
  ```
  /tmp/test_common bitcoin/tx_pool_standard/f18b3744625e0600eb0c/regtest/blocks/xor.dat
  ```

ACKs for top commit:
  kevkevinpal:
    ACK [92d3d69](bitcoin/bitcoin@92d3d69)
  furszy:
    utACK 92d3d69
  tdb3:
    ACK 92d3d69
  dergoegge:
    utACK 92d3d69
  brunoerg:
    code review ACK 92d3d69

Tree-SHA512: 5e83970b111232adece10f79e3a43d0c3c49ab635763e2a4b420f1336cbb8fee94aab751264ddec01ac8363166636e3b29cfe3b2969fc28c8dd6b31bda351950
  • Loading branch information
fanquake committed Nov 21, 2024
2 parents cf57722 + 92d3d69 commit 17834bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/fuzz/fuzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ __AFL_FUZZ_INIT();

const std::function<void(const std::string&)> G_TEST_LOG_FUN{};

const std::function<std::string()> G_TEST_GET_FULL_NAME{};

/**
* A copy of the command line arguments that start with `--`.
* First `LLVMFuzzerInitialize()` is called, which saves the arguments to `g_args`.
Expand Down Expand Up @@ -80,6 +78,9 @@ void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target,
static std::string_view g_fuzz_target;
static const TypeTestOneInput* g_test_one_input{nullptr};

const std::function<std::string()> G_TEST_GET_FULL_NAME{[]{
return std::string{g_fuzz_target};
}};

#if defined(__clang__) && defined(__linux__)
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak));
Expand Down

0 comments on commit 17834bd

Please sign in to comment.