]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121023: Improve `_xxtestfuzz/README.rst` (#121024)
authorsobolevn <mail@sobolevn.me>
Mon, 16 Sep 2024 20:28:09 +0000 (23:28 +0300)
committerGitHub <noreply@github.com>
Mon, 16 Sep 2024 20:28:09 +0000 (23:28 +0300)
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
Modules/_xxtestfuzz/README.rst

index b951858458c82f8fcdf178673525f6a7e0174b16..68d5d589d2a551140352e018e6769944f3cdbe7d 100644 (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.