1
/* KDevelop CMake Support
3
* Copyright 2008 Matt Rogers <mattr@kde.org>
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
#include "cmakeparserutilstest.h"
22
#include "cmakeparserutils.h"
24
QTEST_MAIN( CMakeParserUtilsTest )
26
void CMakeParserUtilsTest::validVersionsTest()
30
QFETCH(QString, version);
31
versions = CMakeParserUtils::parseVersion(version, &ok);
33
QVERIFY(versions.count() != 0);
36
void CMakeParserUtilsTest::validVersionsTest_data()
38
QTest::addColumn<QString>("version");
39
QTest::newRow("zero major version") << QString("0");
40
QTest::newRow("small major version") << QString("2");
41
QTest::newRow("larger major version") << QString("24");
42
QTest::newRow("major.minor") << QString("2.9");
43
QTest::newRow("major.minor.patch") << QString("12.3.2");
46
void CMakeParserUtilsTest::invalidVersionsTest()
50
QFETCH(QString, version);
51
versions = CMakeParserUtils::parseVersion(version, &ok);
53
QVERIFY(versions.count() == 0);
56
void CMakeParserUtilsTest::invalidVersionsTest_data()
58
QTest::addColumn<QString>("version");
59
QTest::newRow("letter version") << QString("A");
60
QTest::newRow("major.minor") << QString("A.B");
61
QTest::newRow("major.minor.patch") << QString("AA.B.C");
65
#include "cmakeparserutilstest.moc"