]> git.donarmstrong.com Git - flightcrew.git/blob - src/FlightCrew/tests/test_main.cpp
Imported Upstream version 0.7.2+dfsg
[flightcrew.git] / src / FlightCrew / tests / test_main.cpp
1 /************************************************************************
2 **
3 **  Copyright (C) 2010  Strahinja Markovic
4 **
5 **  This file is part of FlightCrew.
6 **
7 **  FlightCrew is free software: you can redistribute it and/or modify
8 **  it under the terms of the GNU Lesser General Public License as published
9 **  by the Free Software Foundation, either version 3 of the License, or
10 **  (at your option) any later version.
11 **
12 **  FlightCrew is distributed in the hope that it will be useful,
13 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 **  GNU Lesser General Public License for more details.
16 **
17 **  You should have received a copy of the GNU Lesser General Public License
18 **  along with FlightCrew.  If not, see <http://www.gnu.org/licenses/>.
19 **
20 *************************************************************************/
21
22 #include <stdafx_tests.h>
23 #include <iostream>
24 #include <gmock/gmock.h>
25 #include <xercesc/util/PlatformUtils.hpp>
26
27 namespace xc = XERCES_CPP_NAMESPACE;
28
29 // MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
30 // causes a link error when _tmain is defined in a static library and UNICODE
31 // is enabled. For this reason instead of _tmain, main function is used on
32 // Windows. See the following link to track the current status of this bug:
33 // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 
34 #if GTEST_OS_WINDOWS_MOBILE
35 #include <tchar.h> 
36
37 int _tmain(int argc, TCHAR** argv)
38 {
39 #else
40 int main(int argc, char** argv) 
41 {
42 #endif  // GTEST_OS_WINDOWS_MOBILE
43     std::cout << "Running main() from test_main.cpp\n";
44
45     xc::XMLPlatformUtils::Initialize();
46     
47     testing::InitGoogleMock(&argc, argv);    
48     int test_run_result = RUN_ALL_TESTS();
49     
50     xc::XMLPlatformUtils::Terminate();
51     
52     return test_run_result;
53 }