1
/* KDevelop CMake Support
3
* Copyright 2006 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 "cmakeadddefinitionasttest.h"
23
#include "cmakelistsparser.h"
25
QTEST_MAIN( AddDefinitionsAstTest )
27
void AddDefinitionsAstTest::testGoodParse()
29
QFETCH( CMakeFunctionDesc, function );
30
AddDefinitionsAst* ast = new AddDefinitionsAst();
31
QVERIFY( ast->parseFunctionInfo( function ) == true );
35
void AddDefinitionsAstTest::testGoodParse_data()
37
CMakeFunctionDesc func;
38
func.name = "add_definitions";
40
argList << "-DFOOBAR" << "-DQT_NO_STL";
41
func.addArguments( argList );
43
QTest::addColumn<CMakeFunctionDesc>( "function" );
44
QTest::newRow( "simple" ) << func;
47
void AddDefinitionsAstTest::testBadParse_data()
49
CMakeFunctionDesc func;
50
func.name = "add_definition";
52
argList << "-DFOOBAR" << "-DQT_NO_STL";
53
func.addArguments( argList );
55
QTest::addColumn<CMakeFunctionDesc>( "function" );
56
QTest::newRow( "simple - bad" ) << func;
60
void AddDefinitionsAstTest::testBadParse()
62
QFETCH( CMakeFunctionDesc, function );
63
AddDefinitionsAst* ast = new AddDefinitionsAst();
64
QVERIFY( ast->parseFunctionInfo( function ) == false );
68
#include "cmakeadddefinitionasttest.moc"