-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fuzzing: Add CMake project files for fuzz targets
Change-Id: Ied44bfd2c83d5590066146187a7333b677ceb179 Reviewed-by: Alexandru Croitor <[email protected]>
- Loading branch information
Showing
13 changed files
with
344 additions
and
108 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(next LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_add_executable(next | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(next PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(next PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(next PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
27 changes: 27 additions & 0 deletions
27
tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(fromcbor LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_add_executable(fromcbor | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(fromcbor PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(fromcbor PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(fromcbor PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
27 changes: 27 additions & 0 deletions
27
tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(extractionoperator-float LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_add_executable(extractionoperator-float | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(extractionoperator-float PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(extractionoperator-float PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(extractionoperator-float PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
27 changes: 27 additions & 0 deletions
27
tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(readnext LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_add_executable(readnext | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(readnext PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(readnext PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(readnext PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
40 changes: 20 additions & 20 deletions
40
tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
# Generated from optimize.pro. | ||
cmake_minimum_required(VERSION 3.14) | ||
project(optimize LANGUAGES CXX) | ||
|
||
##################################################################### | ||
## optimize Binary: | ||
##################################################################### | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
qt_internal_add_executable(optimize | ||
GUI | ||
SOURCES | ||
main.cpp | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:optimize.pro:<TRUE>: | ||
# FUZZ_ENGINE = "$$(LIB_FUZZING_ENGINE)" | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
## Scopes: | ||
##################################################################### | ||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_internal_extend_target(optimize CONDITION FUZZ_ENGINE_ISEMPTY | ||
LINK_OPTIONS | ||
"-fsanitize=fuzzer" | ||
qt_add_executable(optimize | ||
main.cpp | ||
) | ||
|
||
qt_internal_extend_target(optimize CONDITION NOT FUZZ_ENGINE_ISEMPTY | ||
PUBLIC_LIBRARIES | ||
$ENV{LIB_FUZZING_ENGINE} | ||
target_link_libraries(optimize PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(optimize PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(optimize PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
27 changes: 27 additions & 0 deletions
27
tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(fromstring LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_add_executable(fromstring | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(fromstring PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(fromstring PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(fromstring PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
27 changes: 27 additions & 0 deletions
27
tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(result LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
|
||
qt_add_executable(result | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(result PUBLIC | ||
Qt::Core | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(result PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(result PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() |
33 changes: 33 additions & 0 deletions
33
tests/libfuzzer/gui/image/qimage/loadfromdata/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(loadfromdata LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
find_package(Qt6 COMPONENTS Core) | ||
find_package(Qt6 COMPONENTS Gui) | ||
|
||
qt_add_executable(loadfromdata | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(loadfromdata PUBLIC | ||
Qt::Core | ||
Qt::Gui | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(loadfromdata PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(loadfromdata PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() | ||
|
||
qt_import_plugins(loadfromdata | ||
INCLUDE Qt::QMinimalIntegrationPlugin | ||
) |
47 changes: 25 additions & 22 deletions
47
tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
# Generated from fromiccprofile.pro. | ||
cmake_minimum_required(VERSION 3.14) | ||
project(fromiccprofile LANGUAGES CXX) | ||
|
||
##################################################################### | ||
## fromiccprofile Binary: | ||
##################################################################### | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
qt_internal_add_executable(fromiccprofile | ||
GUI | ||
SOURCES | ||
main.cpp | ||
PUBLIC_LIBRARIES | ||
Qt::Gui | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:fromiccprofile.pro:<TRUE>: | ||
# FUZZ_ENGINE = "$$(LIB_FUZZING_ENGINE)" | ||
# QTPLUGIN = "qminimal" | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
## Scopes: | ||
##################################################################### | ||
find_package(Qt6 COMPONENTS Core) | ||
find_package(Qt6 COMPONENTS Gui) | ||
|
||
qt_internal_extend_target(fromiccprofile CONDITION FUZZ_ENGINE_ISEMPTY | ||
LINK_OPTIONS | ||
"-fsanitize=fuzzer" | ||
qt_add_executable(fromiccprofile | ||
main.cpp | ||
) | ||
|
||
qt_internal_extend_target(fromiccprofile CONDITION NOT FUZZ_ENGINE_ISEMPTY | ||
PUBLIC_LIBRARIES | ||
target_link_libraries(fromiccprofile PUBLIC | ||
Qt::Core | ||
Qt::Gui | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(fromiccprofile PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(fromiccprofile PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() | ||
|
||
qt_import_plugins(fromiccprofile | ||
INCLUDE Qt::QMinimalIntegrationPlugin | ||
) |
47 changes: 25 additions & 22 deletions
47
tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
# Generated from sethtml.pro. | ||
cmake_minimum_required(VERSION 3.14) | ||
project(sethtml LANGUAGES CXX) | ||
|
||
##################################################################### | ||
## sethtml Binary: | ||
##################################################################### | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
qt_internal_add_executable(sethtml | ||
GUI | ||
SOURCES | ||
main.cpp | ||
PUBLIC_LIBRARIES | ||
Qt::Gui | ||
) | ||
|
||
#### Keys ignored in scope 1:.:.:sethtml.pro:<TRUE>: | ||
# FUZZ_ENGINE = "$$(LIB_FUZZING_ENGINE)" | ||
# QTPLUGIN = "qminimal" | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
## Scopes: | ||
##################################################################### | ||
find_package(Qt6 COMPONENTS Core) | ||
find_package(Qt6 COMPONENTS Gui) | ||
|
||
qt_internal_extend_target(sethtml CONDITION FUZZ_ENGINE_ISEMPTY | ||
LINK_OPTIONS | ||
"-fsanitize=fuzzer" | ||
qt_add_executable(sethtml | ||
main.cpp | ||
) | ||
|
||
qt_internal_extend_target(sethtml CONDITION NOT FUZZ_ENGINE_ISEMPTY | ||
PUBLIC_LIBRARIES | ||
target_link_libraries(sethtml PUBLIC | ||
Qt::Core | ||
Qt::Gui | ||
) | ||
if(DEFINED ENV{LIB_FUZZING_ENGINE}) | ||
target_link_libraries(sethtml PRIVATE | ||
$ENV{LIB_FUZZING_ENGINE} | ||
) | ||
else() | ||
target_link_libraries(sethtml PRIVATE | ||
-fsanitize=fuzzer | ||
) | ||
endif() | ||
|
||
qt_import_plugins(sethtml | ||
INCLUDE Qt::QMinimalIntegrationPlugin | ||
) |
Oops, something went wrong.