[3.13] gh-121023: Improve _xxtestfuzz/README.rst (GH-121024) (#124140)

gh-121023: Improve `_xxtestfuzz/README.rst` (GH-121024)
(cherry picked from commit a9c2bc1634)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-09-24 02:23:54 +02:00 committed by GitHub
parent 9a60a9ddaf
commit 9d21c46e31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,7 @@ Add the test name on a new line in ``fuzz_tests.txt``.
In ``fuzzer.c``, add a function to be run::
int $test_name (const char* data, size_t size) {
static int $fuzz_test_name(const char* data, size_t size) {
...
return 0;
}
@ -31,10 +31,12 @@ In ``fuzzer.c``, add a function to be run::
And invoke it from ``LLVMFuzzerTestOneInput``::
#if _Py_FUZZ_YES(fuzz_builtin_float)
rv |= _run_fuzz(data, size, fuzz_builtin_float);
#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_$fuzz_test_name)
rv |= _run_fuzz(data, size, $fuzz_test_name);
#endif
Don't forget to replace ``$fuzz_test_name`` with your actual test name.
``LLVMFuzzerTestOneInput`` will run in oss-fuzz, with each test in
``fuzz_tests.txt`` run separately.