Skip to content

Commit 446203e

Browse files
miss-islingtonsobolevnillia-v
authored
[3.12] gh-121023: Improve _xxtestfuzz/README.rst (GH-121024) (#124141)
gh-121023: Improve `_xxtestfuzz/README.rst` (GH-121024) (cherry picked from commit a9c2bc1) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Illia Volochii <[email protected]>
1 parent 1151dd6 commit 446203e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Modules/_xxtestfuzz/README.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ Add the test name on a new line in ``fuzz_tests.txt``.
2020

2121
In ``fuzzer.c``, add a function to be run::
2222

23-
int $test_name (const char* data, size_t size) {
23+
static int $fuzz_test_name(const char* data, size_t size) {
2424
...
2525
return 0;
2626
}
2727

2828

2929
And invoke it from ``LLVMFuzzerTestOneInput``::
3030

31-
#if _Py_FUZZ_YES(fuzz_builtin_float)
32-
rv |= _run_fuzz(data, size, fuzz_builtin_float);
31+
#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_$fuzz_test_name)
32+
rv |= _run_fuzz(data, size, $fuzz_test_name);
3333
#endif
3434

35+
Don't forget to replace ``$fuzz_test_name`` with your actual test name.
36+
3537
``LLVMFuzzerTestOneInput`` will run in oss-fuzz, with each test in
3638
``fuzz_tests.txt`` run separately.
3739

0 commit comments

Comments
 (0)