summaryrefslogtreecommitdiffstats
path: root/Modules/_xxtestfuzz
diff options
context:
space:
mode:
authorsobolevn <mail@sobolevn.me>2024-09-16 20:28:09 (GMT)
committerGitHub <noreply@github.com>2024-09-16 20:28:09 (GMT)
commita9c2bc16349c2be3005f97249f3ae9699988f218 (patch)
treeb68ba43984d0d1777fc29c6b68dd47e9c5e549ed /Modules/_xxtestfuzz
parent3b45df03a4bd0e21edec43144b8d9bac689d23a0 (diff)
downloadcpython-a9c2bc16349c2be3005f97249f3ae9699988f218.zip
cpython-a9c2bc16349c2be3005f97249f3ae9699988f218.tar.gz
cpython-a9c2bc16349c2be3005f97249f3ae9699988f218.tar.bz2
gh-121023: Improve `_xxtestfuzz/README.rst` (#121024)
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
Diffstat (limited to 'Modules/_xxtestfuzz')
-rw-r--r--Modules/_xxtestfuzz/README.rst8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_xxtestfuzz/README.rst b/Modules/_xxtestfuzz/README.rst
index b951858..68d5d58 100644
--- a/Modules/_xxtestfuzz/README.rst
+++ b/Modules/_xxtestfuzz/README.rst
@@ -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.