mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 13:27:09 +00:00
Add infrastructure for building fuzz testing targets with libFuzzer or other fuzzing engines (e.g., OSS-Fuzz's LIB_FUZZING_ENGINE). Features: - CMake_BUILD_FUZZING option in root CMakeLists.txt - Fuzzing/CMakeLists.txt with add_fuzzer() macro - Support for libFuzzer and external fuzzing engines - Documentation in Tests/Fuzzing/README.rst The infrastructure is opt-in and requires a compatible fuzzing engine. If CMake_BUILD_FUZZING is enabled but no engine is found, configuration fails with a clear error message. See Tests/Fuzzing/README.rst for build instructions.
15 lines
667 B
CMake
15 lines
667 B
CMake
set(input "Hello;World;From;CMake")
|
|
string(REPLACE ";" " " spaced "${input}")
|
|
string(REGEX REPLACE "([A-Z])" "_\\1" snake "${spaced}")
|
|
string(REGEX MATCHALL "[A-Za-z]+" words "${spaced}")
|
|
string(GENEX_STRIP "$<TARGET_FILE:foo>" stripped)
|
|
string(APPEND result "line1\n" "line2\n")
|
|
string(PREPEND result "header\n")
|
|
string(CONCAT full "a" "b" "c" "d")
|
|
string(JOIN ":" joined a b c d)
|
|
string(MAKE_C_IDENTIFIER "my-var.name" c_id)
|
|
string(RANDOM LENGTH 16 ALPHABET "0123456789ABCDEF" random)
|
|
string(TIMESTAMP ts "%Y-%m-%d %H:%M:%S")
|
|
string(UUID uuid NAMESPACE 6ba7b810-9dad-11d1-80b4-00c04fd430c8 NAME test TYPE SHA1)
|
|
string(JSON json_val GET "{\"key\":\"value\"}" "key")
|