summaryrefslogtreecommitdiffstats
path: root/tests/libfuzzer/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libfuzzer/corelib')
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro10
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro10
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp9
-rw-r--r--tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro10
-rw-r--r--tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro10
-rw-r--r--tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt41
-rw-r--r--tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro8
-rw-r--r--tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp88
-rw-r--r--tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro10
22 files changed, 341 insertions, 239 deletions
diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt
new file mode 100644
index 0000000000..bb614575d6
--- /dev/null
+++ b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+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 REQUIRED 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()
diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp
index 118f402a15..19001628b2 100644
--- a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp
+++ b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QCborStreamReader>
diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro
deleted file mode 100644
index 6c988c2434..0000000000
--- a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT -= gui
-CONFIG += console
-CONFIG -= app_bundle
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}
diff --git a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt
new file mode 100644
index 0000000000..1ced99cfc4
--- /dev/null
+++ b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+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 REQUIRED 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()
diff --git a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro
deleted file mode 100644
index 6c988c2434..0000000000
--- a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT -= gui
-CONFIG += console
-CONFIG -= app_bundle
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}
diff --git a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp
index 5e2a440d1b..b82b0303ca 100644
--- a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp
+++ b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QCborValue>
diff --git a/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt
new file mode 100644
index 0000000000..095c4733e4
--- /dev/null
+++ b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(fromjson LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+find_package(Qt6 REQUIRED COMPONENTS Core)
+
+qt_add_executable(fromjson
+ main.cpp
+)
+
+target_link_libraries(fromjson PUBLIC
+ Qt::Core
+)
+if(DEFINED ENV{LIB_FUZZING_ENGINE})
+ target_link_libraries(fromjson PRIVATE
+ $ENV{LIB_FUZZING_ENGINE}
+ )
+else()
+ target_link_libraries(fromjson PRIVATE
+ -fsanitize=fuzzer
+ )
+endif()
diff --git a/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp
new file mode 100644
index 0000000000..dec863fd2b
--- /dev/null
+++ b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp
@@ -0,0 +1,9 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QJsonDocument>
+
+extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
+ QJsonDocument::fromJson(QByteArray::fromRawData(Data, Size));
+ return 0;
+}
diff --git a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt
new file mode 100644
index 0000000000..4ab7142d8e
--- /dev/null
+++ b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+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 REQUIRED 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()
diff --git a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro
deleted file mode 100644
index 6c988c2434..0000000000
--- a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT -= gui
-CONFIG += console
-CONFIG -= app_bundle
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}
diff --git a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp
index 10d5c3222e..01a80ab293 100644
--- a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp
+++ b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTextStream>
diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt
new file mode 100644
index 0000000000..642b862da7
--- /dev/null
+++ b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+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 REQUIRED 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()
diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp
index 7b73e6e952..b1f6dc5e50 100644
--- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp
+++ b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QXmlStreamReader>
diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro
deleted file mode 100644
index 6c988c2434..0000000000
--- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT -= gui
-CONFIG += console
-CONFIG -= app_bundle
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}
diff --git a/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt b/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
index a82e5fa340..fcacd7c67d 100644
--- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
@@ -1,27 +1,30 @@
-# Generated from optimize.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-#####################################################################
-## optimize Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.16)
+project(optimize LANGUAGES CXX)
-qt_add_executable(optimize
- GUI
- SOURCES
- main.cpp
-)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
-#### 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 REQUIRED COMPONENTS Core)
-qt_extend_target(optimize CONDITION FUZZ_ENGINE_ISEMPTY
- LINK_OPTIONS
- "-fsanitize=fuzzer"
+qt_add_executable(optimize
+ main.cpp
)
-qt_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()
diff --git a/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp b/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp
index 30a714c250..335b6c0552 100644
--- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp
+++ b/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QRegularExpression>
diff --git a/tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro b/tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro
deleted file mode 100644
index 196aca42eb..0000000000
--- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT -= gui
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}
diff --git a/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt b/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt
new file mode 100644
index 0000000000..b4ffa66760
--- /dev/null
+++ b/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+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 REQUIRED 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()
diff --git a/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp b/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp
new file mode 100644
index 0000000000..a0bbe9b03d
--- /dev/null
+++ b/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp
@@ -0,0 +1,88 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QDateTime>
+
+// Enable to report the currently used format, e.g. when reproducing issues
+// #define LOG_FORMAT
+#ifdef LOG_FORMAT
+#include <QDebug>
+#endif
+
+static const QString formats[] = {
+ QStringLiteral("M/d/yyyy"),
+ QStringLiteral("h"),
+ QStringLiteral("hh"),
+ QStringLiteral("H"),
+ QStringLiteral("HH"),
+ QStringLiteral("m"),
+ QStringLiteral("mm"),
+ QStringLiteral("s"),
+ QStringLiteral("ss"),
+ QStringLiteral("z"),
+ QStringLiteral("zzz"),
+ QStringLiteral("A"),
+ QStringLiteral("t"),
+ QStringLiteral("M/d/yyyy hh:mm"),
+ QStringLiteral("M/d/yyyy hh:mm A"),
+ QStringLiteral("M/d/yyyy, hh:mm"),
+ QStringLiteral("M/d/yyyy, hh:mm A"),
+ QStringLiteral("MMM d yyyy"),
+ QStringLiteral("MMM d yyyy hh:mm"),
+ QStringLiteral("MMM d yyyy hh:mm:ss"),
+ QStringLiteral("MMM d yyyy, hh:mm"),
+ QStringLiteral("MMM d yyyy, hh:mm:ss"),
+ QStringLiteral("MMMM d yyyy"),
+ QStringLiteral("MMMM d yyyy hh:mm"),
+ QStringLiteral("MMMM d yyyy hh:mm:ss"),
+ QStringLiteral("MMMM d yyyy, hh:mm"),
+ QStringLiteral("MMMM d yyyy, hh:mm:ss"),
+ QStringLiteral("MMMM d yyyy, hh:mm:ss t"),
+ QStringLiteral("MMM d, yyyy"),
+ QStringLiteral("MMM d, yyyy hh:mm"),
+ QStringLiteral("MMM d, yyyy hh:mm:ss"),
+ QStringLiteral("MMMM d, yyyy"),
+ QStringLiteral("MMMM d, yyyy hh:mm"),
+ QStringLiteral("MMMM d, yyyy hh:mm:ss"),
+ QStringLiteral("MMMM d, yyyy hh:mm:ss t"),
+ QStringLiteral("d MMM yyyy"),
+ QStringLiteral("d MMM yyyy hh:mm"),
+ QStringLiteral("d MMM yyyy hh:mm:ss"),
+ QStringLiteral("d MMM yyyy, hh:mm"),
+ QStringLiteral("d MMM yyyy, hh:mm:ss"),
+ QStringLiteral("d MMMM yyyy"),
+ QStringLiteral("d MMMM yyyy hh:mm"),
+ QStringLiteral("d MMMM yyyy hh:mm:ss"),
+ QStringLiteral("d MMMM yyyy, hh:mm"),
+ QStringLiteral("d MMMM yyyy, hh:mm:ss"),
+ QStringLiteral("d MMM, yyyy"),
+ QStringLiteral("d MMM, yyyy hh:mm"),
+ QStringLiteral("d MMM, yyyy hh:mm:ss"),
+ QStringLiteral("d MMMM, yyyy"),
+ QStringLiteral("d MMMM, yyyy hh:mm"),
+ QStringLiteral("d MMMM, yyyy hh:mm:ss"),
+ QStringLiteral("yyyy-MM-ddThh:mm:ss.zt"),
+};
+
+// libFuzzer entry-point for testing QDateTimeParser
+extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size)
+{
+ const QString userString = QString::fromUtf8(Data, Size);
+
+ QDateTime::fromString(userString, Qt::TextDate);
+ QDateTime::fromString(userString, Qt::ISODate);
+ QDateTime::fromString(userString, Qt::RFC2822Date);
+ QDateTime::fromString(userString, Qt::ISODateWithMs);
+
+ QDateTime::fromString(userString, formats[0], QCalendar(QCalendar::System::Gregorian));
+ for (int sys = int(QCalendar::System::Julian); sys <= int(QCalendar::System::Last); ++sys)
+ QDateTime::fromString(userString, formats[0], QCalendar(QCalendar::System(sys)));
+
+ for (const auto &format : formats) {
+ #ifdef LOG_FORMAT
+ qDebug() << "Trying format:" << format;
+ #endif
+ QDateTime::fromString(userString, format);
+ }
+ return 0;
+}
diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt b/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt
new file mode 100644
index 0000000000..ceb2f673e8
--- /dev/null
+++ b/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+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 REQUIRED 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()
diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp b/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp
index 71780898bc..738da38e29 100644
--- a/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp
+++ b/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QCryptographicHash>
diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro b/tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro
deleted file mode 100644
index 6c988c2434..0000000000
--- a/tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT -= gui
-CONFIG += console
-CONFIG -= app_bundle
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}