mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-21 22:56:22 +01:00
Merge pull request #1800 from hintjens/master
Cleaning up Windows build for gyp
This commit is contained in:
commit
0dbb918244
4
builds/gyp/build.bat
Normal file
4
builds/gyp/build.bat
Normal file
@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
:- Needs Visual Studio 2015
|
||||
"\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
|
||||
msbuild /m /v:m project.sln
|
@ -21,7 +21,13 @@
|
||||
'conditions': [
|
||||
[ 'OS=="win"', {
|
||||
'defines': [
|
||||
'ZMQ_HAVE_WINDOWS=1'
|
||||
'ZMQ_HAVE_WINDOWS=1',
|
||||
'ZMQ_STATIC'
|
||||
],
|
||||
'libraries': [
|
||||
'ws2_32',
|
||||
'advapi32',
|
||||
'iphlpapi'
|
||||
]
|
||||
}],
|
||||
[ 'OS=="mac"', {
|
||||
|
13
tests/README.md
Normal file
13
tests/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Guidelines for tests
|
||||
|
||||
Write your test case as if you were writing clean application code. It should be safe to compile on all platforms.
|
||||
|
||||
The only include file you should use is `testutil.hpp`. Do not include files from src. Do not use the internal libzmq API or your test case is fair game to be deleted.
|
||||
|
||||
If you must write non-portable code, wrap it in #ifdefs to ensure it will compile and run on all systems.
|
||||
|
||||
Note that testutil.hpp includes platform.h. Do not include it yourself as it changes location depending on the build system and OS.
|
||||
|
||||
All sources must contain the correct header. Please copy from test_system.cpp if you're not certain.
|
||||
|
||||
|
@ -27,16 +27,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../include/zmq.h"
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
int main (void)
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 iMatix Corporation
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 VMware, Inc.
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
@ -29,12 +27,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../include/zmq.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
#include "testutil.hpp"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 iMatix Corporation
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
@ -29,7 +27,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "testutil.hpp"
|
||||
|
||||
int main (void)
|
||||
|
@ -27,9 +27,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "testutil.hpp"
|
||||
#include <unistd.h>
|
||||
|
||||
// DEBUG shouldn't be defined in sources as it will cause a redefined symbol
|
||||
// error when it is defined in the build configuration. It appears that the
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 iMatix Corporation
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
libzmq is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License (LGPL) as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
As a special exception, the Contributors give you permission to link
|
||||
this library with independent modules to produce an executable,
|
||||
regardless of the license terms of these independent modules, and to
|
||||
copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the
|
||||
terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library.
|
||||
If you modify this library, you must extend this exception to your
|
||||
version of the library.
|
||||
|
||||
libzmq 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 Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
void test_setsockopt_tcp_recv_buffer (void)
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 iMatix Corporation
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
@ -29,13 +27,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../include/zmq.h"
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
#include "testutil.hpp"
|
||||
|
||||
#define THREAD_COUNT 100
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
libzmq is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License (LGPL) as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
As a special exception, the Contributors give you permission to link
|
||||
this library with independent modules to produce an executable,
|
||||
regardless of the license terms of these independent modules, and to
|
||||
copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the
|
||||
terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library.
|
||||
If you modify this library, you must extend this exception to your
|
||||
version of the library.
|
||||
|
||||
libzmq 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 Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
const int MAX_SENDS = 10000;
|
||||
|
@ -1,8 +1,34 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
/*
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
libzmq is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License (LGPL) as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
As a special exception, the Contributors give you permission to link
|
||||
this library with independent modules to produce an executable,
|
||||
regardless of the license terms of these independent modules, and to
|
||||
copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the
|
||||
terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library.
|
||||
If you modify this library, you must extend this exception to your
|
||||
version of the library.
|
||||
|
||||
libzmq 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 Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
#if defined (ZMQ_HAVE_WINDOWS)
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 iMatix Corporation
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
@ -29,12 +27,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../include/zmq.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
int main (void)
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2010-2011 250bpm s.r.o.
|
||||
Copyright (c) 2011 iMatix Corporation
|
||||
Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
|
||||
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
@ -29,13 +27,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../include/zmq.h"
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
int main (void)
|
||||
|
@ -29,14 +29,6 @@
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
#if defined ZMQ_HAVE_WINDOWS
|
||||
#include "windows.hpp"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "testutil.hpp"
|
||||
|
||||
void sleep_ (long timeout_)
|
||||
{
|
||||
#if defined ZMQ_HAVE_WINDOWS
|
||||
|
@ -27,11 +27,12 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include "testutil.hpp"
|
||||
|
||||
#if !defined (ZMQ_HAVE_WINDOWS)
|
||||
# include <sys/socket.h>
|
||||
# include <sys/un.h>
|
||||
|
||||
void pre_allocate_sock (void *zmq_socket, const char *path)
|
||||
{
|
||||
struct sockaddr_un addr;
|
||||
@ -211,3 +212,10 @@ int main (void)
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#else
|
||||
int main (void)
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
#endif
|
||||
|
@ -27,11 +27,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include "testutil.hpp"
|
||||
|
||||
#if !defined (ZMQ_HAVE_WINDOWS)
|
||||
#include <netdb.h>
|
||||
|
||||
void pre_allocate_sock (void *zmq_socket, const char *address,
|
||||
const char *port)
|
||||
{
|
||||
@ -204,3 +204,9 @@ int main (void)
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
#else
|
||||
int main (void)
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user