Skip to content

Commit 92d3d69

Browse files
committed
fuzz: Implement G_TEST_GET_FULL_NAME
When BasicTestingSetup is used in fuzz-tests it will now create test directories containing the fuzz target names. Example: /tmp/test_common bitcoin/tx_package_eval/153d7906294f7d0606a7/ This is already implemented for bench and unit tests.
1 parent f34fe08 commit 92d3d69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/fuzz/fuzz.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ __AFL_FUZZ_INIT();
3535

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

38-
const std::function<std::string()> G_TEST_GET_FULL_NAME{};
39-
4038
/**
4139
* A copy of the command line arguments that start with `--`.
4240
* First `LLVMFuzzerInitialize()` is called, which saves the arguments to `g_args`.
@@ -80,6 +78,9 @@ void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target,
8078
static std::string_view g_fuzz_target;
8179
static const TypeTestOneInput* g_test_one_input{nullptr};
8280

81+
const std::function<std::string()> G_TEST_GET_FULL_NAME{[]{
82+
return std::string{g_fuzz_target};
83+
}};
8384

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

0 commit comments

Comments
 (0)