2 * Copyright (C) 2005 Casper S. Hornstrup
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 IfTest::TestProjectIf ( Project
& project
)
25 ARE_EQUAL ( 1, project
.non_if_data
.ifs
.size () );
26 If
& if1
= *project
.non_if_data
.ifs
[0];
27 ARE_EQUAL ( "VAR1", if1
.property
);
28 ARE_EQUAL ( "value1", if1
.value
);
30 ARE_EQUAL ( 1, if1
.data
.compilerFlags
.size () );
31 CompilerFlag
& compilerFlag1
= *if1
.data
.compilerFlags
[0];
32 ARE_EQUAL( "compilerflag1", compilerFlag1
.flag
);
36 IfTest::TestModuleIf ( Project
& project
)
38 ARE_EQUAL ( 1, project
.modules
.size () );
39 Module
& module1
= *project
.modules
[0];
41 ARE_EQUAL ( 1, module1
.non_if_data
.ifs
.size () );
42 If
& if1
= *module1
.non_if_data
.ifs
[0];
43 ARE_EQUAL ( "VAR2", if1
.property
);
44 ARE_EQUAL ( "value2", if1
.value
);
46 ARE_EQUAL ( 1, if1
.data
.files
.size () );
47 File
& file1
= *if1
.data
.files
[0];
48 ARE_EQUAL( SSEP
"file1.c", file1
.name
);
50 ARE_EQUAL ( 1, module1
.non_if_data
.files
.size () );
51 File
& file2
= *module1
.non_if_data
.files
[0];
52 ARE_EQUAL( SSEP
"file2.c", file2
.name
);
54 ARE_EQUAL ( 1, if1
.data
.compilerFlags
.size () );
55 CompilerFlag
& compilerFlag2
= *if1
.data
.compilerFlags
[0];
56 ARE_EQUAL( "compilerflag2", compilerFlag2
.flag
);
62 string
projectFilename ( RBUILD_BASE
"tests/data/if.xml" );
63 Configuration configuration
;
64 Project
project ( configuration
, projectFilename
);
66 TestProjectIf ( project
);
67 TestModuleIf ( project
);