summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <[email protected]>2024-06-05 16:39:03 +0200
committerEdward Welbourne <[email protected]>2024-07-11 15:57:50 +0200
commitb14906884c63b3f5f239d7d008eb23aba66836fa (patch)
tree5bb49f85b48fd43ac9156a78f9e529cc4df9f9ac
parentb984a07da6bab511d695dd3082161645a70f9367 (diff)
Reorganise QtTest 3rdparty to separate its various parts
In the process, update the Linux perf_event.h provenance details to make it possible to find the latest version. Also, remove 3rdparty headers from the module's CMakeLists.txt (where possible) so that anything that includes them makes its 3rdparty dependence visible in the relative path. That can't be applied to cycle_p.h, though, as it's used by the tests. Pick-to: 6.8 Task-number: QTBUG-126080 Change-Id: I3a7099bc123ba7188ad096714cb7ed45ff35a392 Reviewed-by: Jason McDonald <[email protected]>
-rw-r--r--src/corelib/global/qsimd.cpp2
-rw-r--r--src/testlib/3rdparty/cycle/LICENSE.txt (renamed from src/testlib/3rdparty/CYCLE_LICENSE.txt)0
-rw-r--r--src/testlib/3rdparty/cycle/cycle_p.h (renamed from src/testlib/3rdparty/cycle_p.h)0
-rw-r--r--src/testlib/3rdparty/cycle/qt_attribution.json16
-rw-r--r--src/testlib/3rdparty/linux/LICENSE.txt (renamed from src/testlib/3rdparty/LINUX_LICENSE.txt)0
-rw-r--r--src/testlib/3rdparty/linux/perf_event_p.h (renamed from src/testlib/3rdparty/linux_perf_event_p.h)0
-rw-r--r--src/testlib/3rdparty/linux/qt_attribution.json28
-rw-r--r--src/testlib/3rdparty/qt_attribution.json51
-rw-r--r--src/testlib/3rdparty/valgrind/LICENSE.txt (renamed from src/testlib/3rdparty/VALGRIND_LICENSE.txt)0
-rw-r--r--src/testlib/3rdparty/valgrind/callgrind_p.h (renamed from src/testlib/3rdparty/callgrind_p.h)0
-rw-r--r--src/testlib/3rdparty/valgrind/qt_attribution.json20
-rw-r--r--src/testlib/3rdparty/valgrind/valgrind_p.h (renamed from src/testlib/3rdparty/valgrind_p.h)0
-rw-r--r--src/testlib/CMakeLists.txt12
-rw-r--r--src/testlib/qbenchmarkmeasurement.cpp2
-rw-r--r--src/testlib/qbenchmarkperfevents.cpp2
-rw-r--r--src/testlib/qbenchmarktimemeasurers_p.h2
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp2
17 files changed, 77 insertions, 60 deletions
diff --git a/src/corelib/global/qsimd.cpp b/src/corelib/global/qsimd.cpp
index 8bc53815916..2bd1aed573e 100644
--- a/src/corelib/global/qsimd.cpp
+++ b/src/corelib/global/qsimd.cpp
@@ -18,7 +18,7 @@
#include <assert.h>
#ifdef Q_OS_LINUX
-# include "../testlib/3rdparty/valgrind_p.h"
+# include "../testlib/3rdparty/valgrind/valgrind_p.h"
#endif
#define QT_FUNCTION_TARGET_BASELINE
diff --git a/src/testlib/3rdparty/CYCLE_LICENSE.txt b/src/testlib/3rdparty/cycle/LICENSE.txt
index c9b44cb8aae..c9b44cb8aae 100644
--- a/src/testlib/3rdparty/CYCLE_LICENSE.txt
+++ b/src/testlib/3rdparty/cycle/LICENSE.txt
diff --git a/src/testlib/3rdparty/cycle_p.h b/src/testlib/3rdparty/cycle/cycle_p.h
index 95e741a82a0..95e741a82a0 100644
--- a/src/testlib/3rdparty/cycle_p.h
+++ b/src/testlib/3rdparty/cycle/cycle_p.h
diff --git a/src/testlib/3rdparty/cycle/qt_attribution.json b/src/testlib/3rdparty/cycle/qt_attribution.json
new file mode 100644
index 00000000000..1eb932b42f7
--- /dev/null
+++ b/src/testlib/3rdparty/cycle/qt_attribution.json
@@ -0,0 +1,16 @@
+[
+ {
+ "Id": "cycle",
+ "Name": "Cycle",
+ "QDocModule": "qttestlib",
+ "QtUsage": "Used in the Qt Test module.",
+ "Files": "cycle_p.h",
+
+ "Description": "Allows to access the CPU's cycle counters.",
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "LICENSE.txt",
+ "Copyright": ["Copyright (c) 2003, 2006 Matteo Frigo",
+ "Copyright (c) 2003, 2006 Massachusetts Institute of Technology"]
+ }
+]
diff --git a/src/testlib/3rdparty/LINUX_LICENSE.txt b/src/testlib/3rdparty/linux/LICENSE.txt
index c0ff68a2b2a..c0ff68a2b2a 100644
--- a/src/testlib/3rdparty/LINUX_LICENSE.txt
+++ b/src/testlib/3rdparty/linux/LICENSE.txt
diff --git a/src/testlib/3rdparty/linux_perf_event_p.h b/src/testlib/3rdparty/linux/perf_event_p.h
index 6f034f0e96c..6f034f0e96c 100644
--- a/src/testlib/3rdparty/linux_perf_event_p.h
+++ b/src/testlib/3rdparty/linux/perf_event_p.h
diff --git a/src/testlib/3rdparty/linux/qt_attribution.json b/src/testlib/3rdparty/linux/qt_attribution.json
new file mode 100644
index 00000000000..07e82490580
--- /dev/null
+++ b/src/testlib/3rdparty/linux/qt_attribution.json
@@ -0,0 +1,28 @@
+[
+ {
+ "Id": "linuxperf",
+ "Name": "Linux Performance Events",
+ "QDocModule": "qttestlib",
+ "QtUsage": "Used on Linux and Android in the Qt Test module.",
+ "Comment": { "UpstreamFile": "include/uapi/linux/perf_event.h",
+ "Repository": "https://github.com/torvalds/linux",
+ "License-note": "The SPDX's 'WITH Linux-syscall-note' is why we can use it",
+ "Update": [
+ "Not normally needed unless",
+ "New feature in QtTest needs something in a newer version",
+ "or if a Linux port to some new architecture omits old API"
+ ]
+ },
+ "Files": "perf_event_p.h",
+
+ "Description": "Allows access to the Linux kernel's performance events.",
+ "Homepage": "https://www.kernel.org",
+ "Version": "6.0",
+ "License": "GNU General Public License v2.0 only with Linux Syscall Note",
+ "LicenseId": "GPL-2.0-only WITH Linux-syscall-note",
+ "LicenseFile": "LICENSE.txt",
+ "Copyright": ["Copyright (C) 2008-2009, Thomas Gleixner <[email protected]>",
+ "Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar",
+ "Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra"]
+ }
+]
diff --git a/src/testlib/3rdparty/qt_attribution.json b/src/testlib/3rdparty/qt_attribution.json
deleted file mode 100644
index 77f58e7d759..00000000000
--- a/src/testlib/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,51 +0,0 @@
-[
- {
- "Id": "valgrind",
- "Name": "Valgrind",
- "QDocModule": "qttestlib",
- "QtUsage": "Used on Linux ond MacOS in the Qt Test module.",
- "Comment": { "UpstreamFiles": [ "include/valgrind.h.in", "callgrind/callgrind.h" ],
- "License": "These two files are BSD; the rest of valgrind is GPL" },
- "Files": [ "valgrind_p.h", "callgrind_p.h" ],
-
- "Description": "An instrumentation framework for building dynamic analysis tools.",
- "Homepage": "http://valgrind.org/",
- "Version": "3.22.0",
- "License": "BSD 4-clause \"Original\" or \"Old\" License",
- "LicenseId": "BSD-4-Clause",
- "LicenseFile": "VALGRIND_LICENSE.txt",
- "Copyright": ["Copyright (C) 2000-2017 Julian Seward",
- "Copyright (C) 2003-2017 Josef Weidendorfer."]
- },
- {
- "Id": "cycle",
- "Name": "Cycle",
- "QDocModule": "qttestlib",
- "QtUsage": "Used in the Qt Test module.",
- "Files": "cycle_p.h",
-
- "Description": "Allows to access the CPU's cycle counters.",
- "License": "MIT License",
- "LicenseId": "MIT",
- "LicenseFile": "CYCLE_LICENSE.txt",
- "Copyright": ["Copyright (c) 2003, 2006 Matteo Frigo",
- "Copyright (c) 2003, 2006 Massachusetts Institute of Technology"]
- },
- {
- "Id": "linuxperf",
- "Name": "Linux Performance Events",
- "QDocModule": "qttestlib",
- "QtUsage": "Used on Linux and Android in the Qt Test module. Note that this is a copy of the respective Linux header, and the clarifications of the Linux Syscall Note apply.",
- "Files": "linux_perf_event_p.h",
-
- "Description": "Allows access to the Linux kernel's performance events.",
- "Homepage": "https://www.kernel.org",
- "Version": "3.7",
- "License": "GNU General Public License v2.0 only with Linux Syscall Note",
- "LicenseId": "GPL-2.0-only WITH Linux-syscall-note",
- "LicenseFile": "LINUX_LICENSE.txt",
- "Copyright": ["Copyright (C) 2008-2009, Thomas Gleixner <[email protected]>",
- "Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar",
- "Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra"]
- }
-]
diff --git a/src/testlib/3rdparty/VALGRIND_LICENSE.txt b/src/testlib/3rdparty/valgrind/LICENSE.txt
index d17836a47df..d17836a47df 100644
--- a/src/testlib/3rdparty/VALGRIND_LICENSE.txt
+++ b/src/testlib/3rdparty/valgrind/LICENSE.txt
diff --git a/src/testlib/3rdparty/callgrind_p.h b/src/testlib/3rdparty/valgrind/callgrind_p.h
index e971283616a..e971283616a 100644
--- a/src/testlib/3rdparty/callgrind_p.h
+++ b/src/testlib/3rdparty/valgrind/callgrind_p.h
diff --git a/src/testlib/3rdparty/valgrind/qt_attribution.json b/src/testlib/3rdparty/valgrind/qt_attribution.json
new file mode 100644
index 00000000000..f828a1fc072
--- /dev/null
+++ b/src/testlib/3rdparty/valgrind/qt_attribution.json
@@ -0,0 +1,20 @@
+[
+ {
+ "Id": "valgrind",
+ "Name": "Valgrind",
+ "QDocModule": "qttestlib",
+ "QtUsage": "Used on Linux ond MacOS in the Qt Test module.",
+ "Comment": { "UpstreamFiles": [ "include/valgrind.h.in", "callgrind/callgrind.h" ],
+ "License": "These two files are BSD; the rest of valgrind is GPL" },
+ "Files": [ "valgrind_p.h", "callgrind_p.h" ],
+
+ "Description": "An instrumentation framework for building dynamic analysis tools.",
+ "Homepage": "http://valgrind.org/",
+ "Version": "3.22.0",
+ "License": "BSD 4-clause \"Original\" or \"Old\" License",
+ "LicenseId": "BSD-4-Clause",
+ "LicenseFile": "LICENSE.txt",
+ "Copyright": ["Copyright (C) 2000-2017 Julian Seward",
+ "Copyright (C) 2003-2017 Josef Weidendorfer."]
+ }
+]
diff --git a/src/testlib/3rdparty/valgrind_p.h b/src/testlib/3rdparty/valgrind/valgrind_p.h
index f5e5518265e..f5e5518265e 100644
--- a/src/testlib/3rdparty/valgrind_p.h
+++ b/src/testlib/3rdparty/valgrind/valgrind_p.h
diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt
index a30b5ba17e7..7d117c14139 100644
--- a/src/testlib/CMakeLists.txt
+++ b/src/testlib/CMakeLists.txt
@@ -14,7 +14,7 @@ qt_internal_add_module(Test
QMAKE_MODULE_CONFIG console testlib_defines
EXCEPTIONS
SOURCES
- 3rdparty/cycle_p.h
+ 3rdparty/cycle/cycle_p.h # Needed by tests, so visible to syncqt.
removed_api.cpp # keep first
qabstracttestlogger.cpp qabstracttestlogger_p.h
qasciikey.cpp
@@ -81,7 +81,9 @@ qt_internal_add_module(Test
PRIVATE_MODULE_INTERFACE
Qt::CorePrivate
ATTRIBUTION_FILE_DIR_PATHS
- 3rdparty
+ 3rdparty/cycle
+ 3rdparty/linux
+ 3rdparty/valgrind
EXTRA_CMAKE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/QtTestProperties.cmake"
EXTRA_CMAKE_INCLUDES
@@ -106,10 +108,12 @@ qt_internal_extend_target(Test CONDITION QT_FEATURE_batch_test_support
qtestregistry.cpp qtestregistry_p.h
)
+# 3rdparty/valgrind/*_p.h deliberately omitted, so syncqt doesn't
+# mirror it in generated include/ directory - #include using "..._p.h"
+# with a relative path. Only this module's sources and Core's qsimd.h
+# should need to.
qt_internal_extend_target(Test CONDITION QT_FEATURE_valgrind
SOURCES
- 3rdparty/callgrind_p.h
- 3rdparty/valgrind_p.h
qbenchmarkvalgrind.cpp qbenchmarkvalgrind_p.h
)
diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp
index 99d5b1dd4fa..32a066967a5 100644
--- a/src/testlib/qbenchmarkmeasurement.cpp
+++ b/src/testlib/qbenchmarkmeasurement.cpp
@@ -41,7 +41,7 @@ int QBenchmarkTimeMeasurer::adjustMedianCount(int)
return 1;
}
-#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
+#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle/cycle_p.h
void QBenchmarkTickMeasurer::start()
{
diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp
index c161879a7db..98224615f30 100644
--- a/src/testlib/qbenchmarkperfevents.cpp
+++ b/src/testlib/qbenchmarkperfevents.cpp
@@ -21,7 +21,7 @@
#include <sys/prctl.h>
#include <sys/syscall.h>
-#include "3rdparty/linux_perf_event_p.h"
+#include "3rdparty/linux/perf_event_p.h"
// for PERF_TYPE_HW_CACHE, the config is a bitmask
// lowest 8 bits: cache type
diff --git a/src/testlib/qbenchmarktimemeasurers_p.h b/src/testlib/qbenchmarktimemeasurers_p.h
index 2f1364db02d..ce11a7dc6e8 100644
--- a/src/testlib/qbenchmarktimemeasurers_p.h
+++ b/src/testlib/qbenchmarktimemeasurers_p.h
@@ -34,7 +34,7 @@ private:
QElapsedTimer time;
};
-#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
+#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle/cycle_p.h
class QBenchmarkTickMeasurer : public QBenchmarkMeasurerBase
{
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index bea3066e66e..1663c5d28d2 100644
--- a/src/testlib/qbenchmarkvalgrind.cpp
+++ b/src/testlib/qbenchmarkvalgrind.cpp
@@ -10,7 +10,7 @@
#include <QtCore/qdir.h>
#include <QtCore/qregularexpression.h>
#include <QtCore/qset.h>
-#include <QtTest/private/callgrind_p.h>
+#include "3rdparty/valgrind/callgrind_p.h"
#include <charconv>
#include <optional>