diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-12 23:07:32 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-12 23:07:32 +0000 |
commit | 47562fa92998f8f4289ae9a8048349067754d52e (patch) | |
tree | c1643be8ab17fc607cea748a8bb1d621a5964873 /third_party/fuzztest/docs.rst | |
parent | eeec55b65fe2c3c7647bb70ea44b3c839eb1267c (diff) | |
parent | 646563934a3e2ee26f50171f94d95173a1662e2c (diff) | |
download | pigweed-47562fa92998f8f4289ae9a8048349067754d52e.tar.gz |
Snap for 11566117 from 646563934a3e2ee26f50171f94d95173a1662e2c to sdk-releaseplatform-tools-35.0.1
Change-Id: Iec629b181a2c6905754a4c340e334884e13fd3b4
Diffstat (limited to 'third_party/fuzztest/docs.rst')
-rw-r--r-- | third_party/fuzztest/docs.rst | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/third_party/fuzztest/docs.rst b/third_party/fuzztest/docs.rst new file mode 100644 index 000000000..44e3892ad --- /dev/null +++ b/third_party/fuzztest/docs.rst @@ -0,0 +1,105 @@ +.. _module-pw_third_party_fuzztest: + +======== +FuzzTest +======== +The ``$dir_pw_third_party/fuzztest/`` module provides build files to allow +optionally including upstream FuzzTest. + +.. _module-pw_third_party_fuzztest-using_upstream: + +----------------------- +Using upstream FuzzTest +----------------------- +If you want to use FuzzTest, you must do the following: + +Submodule +========= +Add FuzzTest to your workspace with the following command. + +.. code-block:: sh + + git submodule add https://github.com/google/fuzztest.git \ + third_party/fuzztest + +.. tab-set:: + + .. tab-item:: GN + + Set the GN following GN bauild args: + + * Set ``dir_pw_third_party_fuzztest`` to the location of the FuzzTest + source. If you used the command above, this will be + ``//third_party/fuzztest``. + + * Set ``dir_pw_third_party_abseil_cpp`` to the location of the + :ref:`module-pw_third_party_abseil_cpp` source. + + * Set ``dir_pw_third_party_googletest`` to the location of the + :ref:`module-pw_third_party_googletest` source. + + * Set ``dir_pw_third_party_re2`` to the location of the + :ref:`module-pw_third_party_re2` source. + + This can be set in your ``args.gn`` or ``.gn`` file. For example: + + .. code-block:: + + # Set build arguments here. See `gn help buildargs`. + dir_pw_third_party_abseil_cpp="//third_party/abseil-cpp" + dir_pw_third_party_fuzztest="//third_party/fuzztest" + dir_pw_third_party_googletest="//third_party/googletest" + dir_pw_third_party_re2="//third_party/re2" + + .. tab-item:: CMake + + Set the following CMake variables: + + * Set ``dir_pw_third_party_fuzztest`` to the location of the + FuzzTest source. + + * Set ``dir_pw_third_party_googletest`` to the location of the + :ref:`module-pw_third_party_googletest` source. + + * Set ``pw_unit_test_GOOGLETEST_BACKEND`` to ``pw_third_party.fuzztest``. + + .. tab-item:: Bazel + + Set the following `label flags`_, either in your `target config`_ or on + the command line: + + * ``pw_fuzzer_fuzztest_backend`` to ``@com_google_fuzztest//fuzztest``. + + For example: + + .. code-block:: sh + + bazel test //... \ + --@pigweed//targets:pw_fuzzer_fuzztest_backend=@com_google_fuzztest//fuzztest + +.. _target config: :ref:`_docs-build_system-bazel_configuration` +.. _label flags: :ref:`_docs-build_system-bazel_flags` + +Updating +======== +The GN build files are generated from the third-party Bazel build files using +$dir_pw_build/py/pw_build/generate_3p_gn.py. + +The script uses data taken from ``$dir_pw_third_party/fuzztest/repo.json``. + +The script should be re-run whenever the submodule is updated or the JSON file +is modified. Specify the location of the Bazel repository can be specified using +the ``-w`` option, e.g. + +.. code-block:: sh + + python pw_build/py/pw_build/generate_3p_gn.py \ + -w third_party/fuzztest/src + +.. DO NOT EDIT BELOW THIS LINE. Generated section. + +Version +======= +The update script was last run for revision `3c77f971`_. + +.. _3c77f971: https://github.com/google/fuzztes/tree/3c77f97183a1270796d25db1a8956706a25af238 |