mirror of
https://github.com/python/cpython.git
synced 2025-08-13 13:29:13 +00:00
[3.12] gh-121023: Improve _xxtestfuzz/README.rst
(GH-121024) (#124141)
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:
parent
1151dd6c73
commit
446203e122
1 changed files with 5 additions and 3 deletions
|
@ -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::
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,12 @@ In ``fuzzer.c``, add a function to be run::
|
||||||
|
|
||||||
And invoke it from ``LLVMFuzzerTestOneInput``::
|
And invoke it from ``LLVMFuzzerTestOneInput``::
|
||||||
|
|
||||||
#if _Py_FUZZ_YES(fuzz_builtin_float)
|
#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_$fuzz_test_name)
|
||||||
rv |= _run_fuzz(data, size, fuzz_builtin_float);
|
rv |= _run_fuzz(data, size, $fuzz_test_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Don't forget to replace ``$fuzz_test_name`` with your actual test name.
|
||||||
|
|
||||||
``LLVMFuzzerTestOneInput`` will run in oss-fuzz, with each test in
|
``LLVMFuzzerTestOneInput`` will run in oss-fuzz, with each test in
|
||||||
``fuzz_tests.txt`` run separately.
|
``fuzz_tests.txt`` run separately.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue