File indexing completed on 2024-04-21 05:44:40
0001 /* 0002 * SPDX-FileCopyrightText: 2019 Andreas Cord-Landwehr <cordlandwehr@kde.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef TEST_HEADERDETECTION_H 0008 #define TEST_HEADERDETECTION_H 0009 0010 #include <QObject> 0011 0012 class TestHeaderDetection : public QObject 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 TestHeaderDetection() = default; 0018 0019 private Q_SLOTS: 0020 // example data based tests 0021 void detectGPL20_or_GPL30_or_KDE(); 0022 void detectGPL20only(); 0023 void detectGPL20orlater(); 0024 void detectGPL2orlaterwithQtCommercialException(); 0025 void detectGPL30orlater(); 0026 void detectGPL30_or_KDE(); 0027 void detectLGPL20orlater(); 0028 void detectLGPL20only(); 0029 void detectLGPL20onlyWithQtCommercialException(); 0030 void detectLGPL21only(); 0031 void detectLGPL21onlyOrLGPL30only(); 0032 void detectLGPL21orlater(); 0033 void detectLGPL20_or_LGPL30(); 0034 void detectLGPL21_or_LGPL30_or_KDE(); 0035 void detectLGPL30orlater(); 0036 void detectLGPL30onlyOrGPL20orlater(); 0037 void detectBSD2Clause(); 0038 void detectBSD3Clause(); 0039 void detectMIT(); 0040 void detectX11(); 0041 void detectLGPL21withQtLGPLexception_or_QtCommercial(); 0042 void detectLGPL21withQtLGPLexceptionOrLGPL30withQtLGPLexception(); 0043 void detectLGPL30_or_GPL20_or_GPL30_or_GPLKFQF_or_QtCommercial(); 0044 0045 // detection logic tests 0046 void detectSpdxExpressions(); 0047 0048 private: 0049 void detectForIdentifierRegExpParser(const QString &spdxMarker); 0050 void detectForIdentifierSkipParser(const QString &spdxMarker); 0051 }; 0052 #endif