fixed: silenced gtest warning on osx106

This commit is contained in:
Nick Bolton 2014-02-28 13:56:07 +00:00
parent 19bcb9dfae
commit ad8905ccbf
23 changed files with 102 additions and 34 deletions

32
src/test/global/gmock.h Normal file
View File

@ -0,0 +1,32 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2014 Bolton Software Ltd.
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// HACK: gcc on osx106 doesn't give you an easy way to hide warnings
// from included headers, so use the system_header pragma. the downside
// is that everything in the header file following this also has warnings
// ignored, so we need to put it in a separate header file.
#if __APPLE__
# pragma GCC system_header
#endif
// gmock includes gtest which has a warning on osx106 (signed/unsigned
// int compare), so include our special header here first to silence
// the warning.
#include "test/global/gtest.h"
#include <gmock/gmock.h>

View File

@ -25,4 +25,5 @@
# pragma GCC system_header
#endif
// gtest has a warning on osx106 (signed/unsigned int compare).
#include <gtest/gtest.h>

View File

@ -14,16 +14,26 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
file(GLOB headers "*.h")
file(GLOB sources "*.cpp")
file(GLOB_RECURSE headers "*.h")
file(GLOB_RECURSE sources "*.cpp")
# remove arch files (specific arch added later).
file(GLOB remove_arch "arch/*")
list(REMOVE_ITEM headers ${remove_arch})
list(REMOVE_ITEM sources ${remove_arch})
# remove platform files (specific platform added later).
file(GLOB remove_platform "platform/*")
list(REMOVE_ITEM headers ${remove_platform})
list(REMOVE_ITEM sources ${remove_platform})
# arch
if (WIN32)
file(GLOB arch_sources "arch/CArchWindows*.cpp")
file(GLOB arch_headers "arch/CArchWindows*.h")
file(GLOB arch_sources "arch/ArchWindows*.cpp")
file(GLOB arch_headers "arch/ArchWindows*.h")
elseif (UNIX)
file(GLOB arch_sources "arch/CArchUnix*.cpp")
file(GLOB arch_headers "arch/CArchUnix*.h")
file(GLOB arch_sources "arch/ArchUnix*.cpp")
file(GLOB arch_headers "arch/ArchUnix*.h")
endif()
list(APPEND sources ${arch_sources})
@ -31,19 +41,31 @@ list(APPEND headers ${arch_headers})
# platform
if (WIN32)
file(GLOB platform_sources "platform/CMSWindows*.cpp")
file(GLOB platform_headers "platform/CMSWindows*.h")
file(GLOB platform_sources "platform/MSWindows*.cpp")
file(GLOB platform_headers "platform/MSWindows*.h")
elseif (APPLE)
file(GLOB platform_sources "platform/COSX*.cpp")
file(GLOB platform_headers "platform/COSX*.h")
file(GLOB platform_sources "platform/OSX*.cpp")
file(GLOB platform_headers "platform/OSX*.h")
elseif (UNIX)
file(GLOB platform_sources "platform/CXWindows*.cpp")
file(GLOB platform_headers "platform/CXWindows*.h")
file(GLOB platform_sources "platform/XWindows*.cpp")
file(GLOB platform_headers "platform/XWindows*.h")
endif()
list(APPEND sources ${platform_sources})
list(APPEND headers ${platform_headers})
file(GLOB_RECURSE global_headers "../../test/global/*.h")
file(GLOB_RECURSE global_sources "../../test/global/*.cpp")
list(APPEND headers ${global_headers})
list(APPEND sources ${global_sources})
file(GLOB_RECURSE mock_headers "../../test/mock/*.h")
file(GLOB_RECURSE mock_sources "../../test/mock/*.cpp")
list(APPEND headers ${mock_headers})
list(APPEND sources ${mock_sources})
if (SYNERGY_ADD_HEADERS)
list(APPEND sources ${headers})
endif()

View File

@ -23,7 +23,7 @@
#include "arch/win32/ArchMiscWindows.h"
#endif
#include <gtest/gtest.h>
#include "test/global/gtest.h"
#include <iostream>
#include <fstream>

View File

@ -18,7 +18,7 @@
#include "platform/OSXClipboard.h"
#include <gtest/gtest.h>
#include "test/global/gtest.h"
#include <iostream>
TEST(COSXClipboardTests, empty_openCalled_returnsTrue)

View File

@ -16,13 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "test/mock/synergy/MockKeyMap.h"
#include "test/mock/synergy/MockEventQueue.h"
#include "platform/OSXKeyState.h"
#include "synergy/CMockKeyMap.h"
#include "synergy/CMockEventQueue.h"
#include "base/Log.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "test/global/gtest.h"
#include "test/global/gmock.h"
#define SHIFT_ID_L kKeyShift_L
#define SHIFT_ID_R kKeyShift_R

View File

@ -20,7 +20,7 @@
#include "arch/Arch.h"
#include "base/EventQueue.h"
#include <gtest/gtest.h>
#include "test/global/gtest.h"
// disabling these tests - the return value of CGCursorIsVisible is unreliable.
/*

View File

@ -22,7 +22,7 @@
#include "client/Client.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class IEventQueue;

View File

@ -20,7 +20,7 @@
#include "io/CryptoStream.h"
#include "io/CryptoOptions.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockCryptoStream : public CCryptoStream
{

View File

@ -20,7 +20,7 @@
#include "io/IStream.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class IEventQueue;

View File

@ -21,7 +21,7 @@
#include "server/Config.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockConfig : public CConfig
{

View File

@ -21,7 +21,7 @@
#include "server/InputFilter.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockInputFilter : public CInputFilter
{

View File

@ -22,7 +22,7 @@
#include "synergy/PrimaryClient.h"
#include "base/String.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockPrimaryClient : public CPrimaryClient
{

View File

@ -20,7 +20,7 @@
#include "base/IEventQueue.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockEventQueue : public IEventQueue
{

View File

@ -20,7 +20,7 @@
#include "synergy/KeyMap.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockKeyMap : public CKeyMap
{

View File

@ -21,7 +21,7 @@
#include "synergy/Screen.h"
#include <gmock/gmock.h>
#include "test/global/gmock.h"
class CMockScreen : public CScreen
{

View File

@ -17,6 +17,18 @@
file(GLOB_RECURSE headers "*.h")
file(GLOB_RECURSE sources "*.cpp")
file(GLOB_RECURSE global_headers "../../test/global/*.h")
file(GLOB_RECURSE global_sources "../../test/global/*.cpp")
list(APPEND headers ${global_headers})
list(APPEND sources ${global_sources})
file(GLOB_RECURSE mock_headers "../../test/mock/*.h")
file(GLOB_RECURSE mock_sources "../../test/mock/*.cpp")
list(APPEND headers ${mock_headers})
list(APPEND sources ${mock_sources})
include_directories(
../../
../../lib/

View File

@ -23,7 +23,7 @@
#include "arch/win32/ArchMiscWindows.h"
#endif
#include <gtest/gtest.h>
#include "test/global/gtest.h"
int
main(int argc, char **argv)

View File

@ -24,7 +24,7 @@
#include "client/ServerProxy.h"
#include "synergy/protocol_types.h"
#include <gtest/gtest.h>
#include "test/global/gtest.h"
using ::testing::_;
using ::testing::Invoke;

View File

@ -21,7 +21,7 @@
#include "test/mock/synergy/MockEventQueue.h"
#include "server/ClientProxy1_4.h"
#include <gtest/gtest.h>
#include "test/global/gtest.h"
using ::testing::_;
using ::testing::NiceMock;

View File

@ -21,7 +21,7 @@
#include "io/CryptoStream.h"
#include "io/CryptoOptions.h"
#include <gtest/gtest.h>
#include "test/global/gtest.h"
using ::testing::_;
using ::testing::Invoke;

View File

@ -17,11 +17,12 @@
*/
#include "test/unittests/synergy/KeyStateTests.h"
#include "test/mock/synergy/MockEventQueue.h"
#include "test/mock/synergy/MockKeyMap.h"
#include <gmock/gmock.h>
#include "test/global/gtest.h"
#include "test/global/gmock.h"
using ::testing::_;
using ::testing::NiceMock;

View File

@ -20,7 +20,7 @@
#include "synergy/KeyState.h"
#include "gmock/gmock.h"
#include "test/global/gmock.h"
class CMockKeyMap;
class CMockEventQueue;