1f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// Copyright 2008, Google Inc.
2f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// All rights reserved.
3f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//
4f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// Redistribution and use in source and binary forms, with or without
5f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// modification, are permitted provided that the following conditions are
6f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// met:
7f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//
8f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//     * Redistributions of source code must retain the above copyright
9f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// notice, this list of conditions and the following disclaimer.
10f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//     * Redistributions in binary form must reproduce the above
11f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// copyright notice, this list of conditions and the following disclaimer
12f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// in the documentation and/or other materials provided with the
13f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// distribution.
14f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//     * Neither the name of Google Inc. nor the names of its
15f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// contributors may be used to endorse or promote products derived from
16f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// this software without specific prior written permission.
17f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//
18f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch//
30f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// Author: wan@google.com (Zhanyong Wan)
31f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch
32f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch#include <iostream>
33f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch#include "gmock/gmock.h"
34f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch#include "gtest/gtest.h"
35f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch
36f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
37f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// causes a link error when _tmain is defined in a static library and UNICODE
38f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// is enabled. For this reason instead of _tmain, main function is used on
39f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// Windows. See the following link to track the current status of this bug:
40f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464  // NOLINT
41f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch#if GTEST_OS_WINDOWS_MOBILE
42f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch# include <tchar.h>  // NOLINT
43f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch
44f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen MurdochGTEST_API_ int _tmain(int argc, TCHAR** argv) {
45f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch#else
46f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen MurdochGTEST_API_ int main(int argc, char** argv) {
47f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch#endif  // GTEST_OS_WINDOWS_MOBILE
48f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch  std::cout << "Running main() from gmock_main.cc\n";
49f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch  // Since Google Mock depends on Google Test, InitGoogleMock() is
50f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch  // also responsible for initializing Google Test.  Therefore there's
51f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch  // no need for calling testing::InitGoogleTest() separately.
52f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch  testing::InitGoogleMock(&argc, argv);
53f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch  return RUN_ALL_TESTS();
54f91f0611dbaf29ca0f1d4aecb357ce243a19d2faBen Murdoch}
55