]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-121023: Improve `_xxtestfuzz/README.rst` (GH-121024) (#124141)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 16 Sep 2024 20:29:02 +0000 (22:29 +0200)
committerGitHub <noreply@github.com>
Mon, 16 Sep 2024 20:29:02 +0000 (20:29 +0000)
gh-121023: Improve `_xxtestfuzz/README.rst` (GH-121024)
(cherry picked from commit a9c2bc16349c2be3005f97249f3ae9699988f218)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
Modules/_xxtestfuzz/README.rst

index 42bd02a03cbeddac2c3485a023c6a26b4c01a870..27c44f7bb8e5c735e669c43cf7a85158b814bef3 100644 (file)
@@ -20,7 +20,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;
     }
@@ -28,10 +28,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.