2011-04-23 23:57:32 +00:00
|
|
|
/*
|
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
|
|
|
|
* Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
|
|
|
|
|
*
|
|
|
|
|
* 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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <gtest/gtest.h>
|
2011-04-24 21:58:26 +00:00
|
|
|
#include "CArch.h"
|
2011-05-09 00:28:45 +00:00
|
|
|
#include "CLog.h"
|
2011-04-24 21:58:26 +00:00
|
|
|
|
2011-04-24 17:37:15 +00:00
|
|
|
#if SYSAPI_WIN32
|
2011-04-23 23:57:32 +00:00
|
|
|
#include "CArchMiscWindows.h"
|
2011-04-24 17:37:15 +00:00
|
|
|
#endif
|
2011-04-23 23:57:32 +00:00
|
|
|
|
2011-05-06 22:58:12 +00:00
|
|
|
#if SYSAPI_UNIX
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
#define LOCK_FILE "/tmp/integtests.lock"
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-05-06 21:13:07 +00:00
|
|
|
#define ERROR_ALREADY_RUNNING 1
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
2011-05-06 22:58:12 +00:00
|
|
|
#if SYSAPI_UNIX
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
signalHandler(int signal);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
removeLock();
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-04-23 23:57:32 +00:00
|
|
|
int
|
|
|
|
|
main(int argc, char **argv)
|
|
|
|
|
{
|
2011-06-18 23:44:23 +00:00
|
|
|
#if SYSAPI_WIN32
|
|
|
|
|
if (CArchMiscWindows::isWindows95Family())
|
|
|
|
|
{
|
|
|
|
|
std::cerr << "Windows 95 family not supported." << std::endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-05-06 22:58:12 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-04-23 23:57:32 +00:00
|
|
|
#if SYSAPI_WIN32
|
|
|
|
|
// record window instance for tray icon, etc
|
|
|
|
|
CArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
CArch arch;
|
|
|
|
|
|
2011-05-09 00:28:45 +00:00
|
|
|
CLOG->setFilter(kDEBUG2);
|
|
|
|
|
|
2011-04-23 23:57:32 +00:00
|
|
|
testing::InitGoogleTest(&argc, argv);
|
|
|
|
|
|
|
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
|
}
|