diff --git a/builds/gyp/project.gyp b/builds/gyp/project.gyp index 1989ac66..17d0e6d2 100644 --- a/builds/gyp/project.gyp +++ b/builds/gyp/project.gyp @@ -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"', { diff --git a/tests/README.md b/tests/README.md index 6ae49702..cdf826b3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -8,4 +8,6 @@ If you must write non-portable code, wrap it in #ifdefs to ensure it will compil 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. + diff --git a/tests/test_connect_delay_tipc.cpp b/tests/test_connect_delay_tipc.cpp index 1062aba3..c6a2a64e 100644 --- a/tests/test_connect_delay_tipc.cpp +++ b/tests/test_connect_delay_tipc.cpp @@ -27,16 +27,6 @@ along with this program. If not, see . */ -#include "../include/zmq.h" -#include -#include -#include -#include -#include - -#undef NDEBUG -#include - #include "testutil.hpp" int main (void) diff --git a/tests/test_pair_tipc.cpp b/tests/test_pair_tipc.cpp index 2766b232..7c3ed697 100644 --- a/tests/test_pair_tipc.cpp +++ b/tests/test_pair_tipc.cpp @@ -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++. diff --git a/tests/test_reqrep_device_tipc.cpp b/tests/test_reqrep_device_tipc.cpp index e1154214..55d2c6f3 100644 --- a/tests/test_reqrep_device_tipc.cpp +++ b/tests/test_reqrep_device_tipc.cpp @@ -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 . */ -#include "../include/zmq.h" -#include -#include - -#undef NDEBUG -#include +#include "testutil.hpp" int main (void) { diff --git a/tests/test_reqrep_tipc.cpp b/tests/test_reqrep_tipc.cpp index 7099a4e9..b54287c4 100644 --- a/tests/test_reqrep_tipc.cpp +++ b/tests/test_reqrep_tipc.cpp @@ -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 . */ -#include #include "testutil.hpp" int main (void) diff --git a/tests/test_router_mandatory_hwm.cpp b/tests/test_router_mandatory_hwm.cpp index 29bbba43..9d19cd25 100644 --- a/tests/test_router_mandatory_hwm.cpp +++ b/tests/test_router_mandatory_hwm.cpp @@ -27,9 +27,7 @@ along with this program. If not, see . */ -#include #include "testutil.hpp" -#include // 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 diff --git a/tests/test_router_mandatory_tipc.cpp b/tests/test_router_mandatory_tipc.cpp index da5e33fb..0d0e1916 100644 --- a/tests/test_router_mandatory_tipc.cpp +++ b/tests/test_router_mandatory_tipc.cpp @@ -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++. diff --git a/tests/test_setsockopt.cpp b/tests/test_setsockopt.cpp index 1dcc3266..fe659bf6 100644 --- a/tests/test_setsockopt.cpp +++ b/tests/test_setsockopt.cpp @@ -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 . +*/ + #include "testutil.hpp" void test_setsockopt_tcp_recv_buffer (void) diff --git a/tests/test_shutdown_stress_tipc.cpp b/tests/test_shutdown_stress_tipc.cpp index 5c52d014..905cb856 100644 --- a/tests/test_shutdown_stress_tipc.cpp +++ b/tests/test_shutdown_stress_tipc.cpp @@ -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 . */ -#include "../include/zmq.h" -#include -#include -#include - -#undef NDEBUG -#include +#include "testutil.hpp" #define THREAD_COUNT 100 diff --git a/tests/test_sockopt_hwm.cpp b/tests/test_sockopt_hwm.cpp index a8b22f40..c9b6fa2f 100644 --- a/tests/test_sockopt_hwm.cpp +++ b/tests/test_sockopt_hwm.cpp @@ -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 . +*/ + #include "testutil.hpp" const int MAX_SENDS = 10000; diff --git a/tests/test_stream_exceeds_buffer.cpp b/tests/test_stream_exceeds_buffer.cpp index 75a80d88..fe526b73 100644 --- a/tests/test_stream_exceeds_buffer.cpp +++ b/tests/test_stream_exceeds_buffer.cpp @@ -1,8 +1,34 @@ -#include -#include -#include +/* + 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 . +*/ #include "testutil.hpp" + #if defined (ZMQ_HAVE_WINDOWS) # include # include diff --git a/tests/test_sub_forward_tipc.cpp b/tests/test_sub_forward_tipc.cpp index 4d98c54a..5fe011c4 100644 --- a/tests/test_sub_forward_tipc.cpp +++ b/tests/test_sub_forward_tipc.cpp @@ -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 . */ -#include "../include/zmq.h" -#include - -#undef NDEBUG -#include - #include "testutil.hpp" int main (void) diff --git a/tests/test_term_endpoint_tipc.cpp b/tests/test_term_endpoint_tipc.cpp index 949a1d14..adbe9e74 100644 --- a/tests/test_term_endpoint_tipc.cpp +++ b/tests/test_term_endpoint_tipc.cpp @@ -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 . */ -#include "../include/zmq.h" -#include -#include - -#undef NDEBUG -#include - #include "testutil.hpp" int main (void) diff --git a/tests/test_timers.cpp b/tests/test_timers.cpp index f0d1becf..1bb35286 100644 --- a/tests/test_timers.cpp +++ b/tests/test_timers.cpp @@ -29,14 +29,6 @@ #include "testutil.hpp" -#if defined ZMQ_HAVE_WINDOWS -#include "windows.hpp" -#else -#include -#endif - -#include "testutil.hpp" - void sleep_ (long timeout_) { #if defined ZMQ_HAVE_WINDOWS diff --git a/tests/test_use_fd_ipc.cpp b/tests/test_use_fd_ipc.cpp index 0e65d17a..26f85157 100644 --- a/tests/test_use_fd_ipc.cpp +++ b/tests/test_use_fd_ipc.cpp @@ -27,11 +27,12 @@ along with this program. If not, see . */ -#include -#include -#include #include "testutil.hpp" +#if !defined (ZMQ_HAVE_WINDOWS) +# include +# include + 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 diff --git a/tests/test_use_fd_tcp.cpp b/tests/test_use_fd_tcp.cpp index db8b7771..db34872d 100644 --- a/tests/test_use_fd_tcp.cpp +++ b/tests/test_use_fd_tcp.cpp @@ -27,11 +27,11 @@ along with this program. If not, see . */ -#include -#include -#include #include "testutil.hpp" +#if !defined (ZMQ_HAVE_WINDOWS) +#include + 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