summaryrefslogtreecommitdiff
path: root/tests/libfuzzer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libfuzzer')
-rw-r--r--tests/libfuzzer/svg/qsvgrenderer/render/CMakeLists.txt36
-rw-r--r--tests/libfuzzer/svg/qsvgrenderer/render/main.cpp34
-rw-r--r--tests/libfuzzer/svg/qsvgrenderer/render/render.pro9
3 files changed, 43 insertions, 36 deletions
diff --git a/tests/libfuzzer/svg/qsvgrenderer/render/CMakeLists.txt b/tests/libfuzzer/svg/qsvgrenderer/render/CMakeLists.txt
new file mode 100644
index 0000000..58f4750
--- /dev/null
+++ b/tests/libfuzzer/svg/qsvgrenderer/render/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(render 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 Svg)
+
+qt_add_executable(render
+ main.cpp
+)
+
+target_link_libraries(render PUBLIC
+ Qt::Core
+ Qt::Svg
+)
+if(DEFINED ENV{LIB_FUZZING_ENGINE})
+ target_link_libraries(render PRIVATE
+ $ENV{LIB_FUZZING_ENGINE}
+ )
+else()
+ target_link_libraries(render PRIVATE
+ -fsanitize=fuzzer
+ )
+endif()
+
+qt_import_plugins(render
+ INCLUDE Qt::QMinimalIntegrationPlugin
+)
diff --git a/tests/libfuzzer/svg/qsvgrenderer/render/main.cpp b/tests/libfuzzer/svg/qsvgrenderer/render/main.cpp
index b835f0a..877274f 100644
--- a/tests/libfuzzer/svg/qsvgrenderer/render/main.cpp
+++ b/tests/libfuzzer/svg/qsvgrenderer/render/main.cpp
@@ -1,35 +1,15 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 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) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QGuiApplication>
#include <QImage>
#include <QPainter>
#include <QSvgRenderer>
+#include <QtGlobal>
+
+// silence warnings
+static QtMessageHandler mh = qInstallMessageHandler([](QtMsgType, const QMessageLogContext &,
+ const QString &) {});
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
static int argc = 3;
diff --git a/tests/libfuzzer/svg/qsvgrenderer/render/render.pro b/tests/libfuzzer/svg/qsvgrenderer/render/render.pro
deleted file mode 100644
index 21238dc..0000000
--- a/tests/libfuzzer/svg/qsvgrenderer/render/render.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-QT += svg
-QTPLUGIN *= qminimal
-SOURCES += main.cpp
-FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE)
-isEmpty(FUZZ_ENGINE) {
- QMAKE_LFLAGS += -fsanitize=fuzzer
-} else {
- LIBS += $$FUZZ_ENGINE
-}