Commit Graph

4533 Commits

Author SHA1 Message Date
Pieter Hintjens
c78e4f33a3 Problem: if src/platform.hpp still exists, gyp uses this
Gyp needs its own platform.hpp; there is no way to delete this
file automatically.

Solution: copy gyp's platform.hpp into src, so that things build
properly no matter what the starting state. If you build with gyp
and then try to build using autotools' makefile, you'll get an
error from the platform.hpp.
2016-02-17 12:06:45 +01:00
Pieter Hintjens
9bebd4dce9 Problem: local build should do its own .gitignore
Solution: add .gitignore in builds/gyp
2016-02-17 12:06:45 +01:00
Pieter Hintjens
8559770cf3 Problem: in builds/gyp, socket limit is 4K on Windows
Solution: raise to 16K
2016-02-17 12:06:45 +01:00
Pieter Hintjens
4a481c857f Problem: socket limit is still 4K on Windows
Solution: fix in CMakeLists.txt (already fixed in builds/msvc)
2016-02-17 12:06:45 +01:00
Pieter Hintjens
df6876abde Merge pull request #1805 from bluca/uninitialised_sockopt
Problem: curve keys getsockopt uninitialised read
2016-02-16 14:05:07 +01:00
Luca Boccassi
f86795350d Problem: curve keys getsockopt uninitialised read
Solution: always initialised zmq::options_t class variables arrays to
avoid reading uninitialised data when CURVE is not yet configured and
a getsockopt ZMQ_CURVE_{SERVER | PUBLIC | SECRET]KEY is issued.
2016-02-16 12:00:55 +00:00
Pieter Hintjens
93f99d09f4 Merge pull request #1804 from bluca/test_fixes
Various test fixes
2016-02-13 19:37:08 +01:00
Luca Boccassi
facb512105 Problem: SETTLE_TIME is too short on slow systems
Solution: increase SETTLE_TIME from 50ms to 300ms to avoid failing on
slower environments like through Valgrind on slow VMs.
2016-02-13 18:17:36 +00:00
Luca Boccassi
217f6c438e Problem: tests README does not document msleep
Solution: suggest to use the common approach of msleep (SETTLE_TIME)
after a connect if necessary, rather than reimplementing a different
way.
2016-02-13 18:04:25 +00:00
Luca Boccassi
706c3b7c4b Problem: test_shutdown_stress_tipc broken on OSX/Cmake
Solution: include pthread.h in testutil.hpp, removed from
test_shutdown_stress_tipc in an earlier commit
2016-02-13 18:01:03 +00:00
Luca Boccassi
63a0924484 Problem: test_sockopt_hwm not renamed in gitignore
Solution: rename from test_socketopt_hwm to test_sockopt_hwm in
.gitignore too
2016-02-13 18:01:03 +00:00
Luca Boccassi
cb41201880 Problem: various tests fail in slow environments
Solution: add msleep (SETTLE_TIME) to test_immediate, test_spec_rep
and test_spec_router after the sockets are created and connected to
avoid failing when running in slower environment like through
Valgrind in underpowered VMs.
2016-02-13 18:01:03 +00:00
Luca Boccassi
4a84f8a02e Problem: tests use various sleep patterns to wait
Solution: use msleep (SETTLE_TIME) everywhere when waiting for the
connections/sockets to be settled instead of a variety of patterns
and functions to make tests more coherent.
2016-02-13 18:01:03 +00:00
Luca Boccassi
955b51dfd2 Problem: test_msg_ffn uses unitialised memory
Solution: memset temporary buffer before use to reduce Valgrind noise
2016-02-13 16:28:48 +00:00
Luca Boccassi
240190131c Problem: test_srcfd uses unitialised memory
Solution: memset temporary buffer before use to reduce Valgrind noise
2016-02-13 15:39:30 +00:00
Luca Boccassi
302c7bee50 Problem: test_fork does not clean up at exit
Solution: close socket and destroy context to reduce Valgrind noise
2016-02-13 11:35:51 +00:00
Luca Boccassi
f87888f80c Problem: test_router_mandatory_hwm uses unitialised memory
Solution: memset temporary buffer before use to reduce Valgrind noise
2016-02-13 11:35:51 +00:00
Luca Boccassi
cffc653535 Problem: test_pre_allocated_fd_tcp leaks addrinfo
Solution: free addrinfo to reduce Valgrind noise
2016-02-13 11:35:51 +00:00
Luca Boccassi
05ad915265 Problem: test_term_endpoint does not clean up at exit
Solution: close socket and destroy context to reduce Valgrind noise
2016-02-13 11:35:51 +00:00
Luca Boccassi
f8f8043222 Problem: test_msg_ffn uses unitialised memory
Solution: pass correct size to memcmp to avoid reading uninitialised
areas of the buffer.
2016-02-13 11:35:51 +00:00
Luca Boccassi
e177512c82 Problem: test_system does not clean up at exit
Solution: close socket and destroy context to reduce Valgrind noise
2016-02-13 11:35:51 +00:00
Constantin Rack
18dcc32ac3 Merge pull request #1803 from bluca/ci_default_only_on_secondary
Problem: too many CI builds
2016-02-13 01:18:47 +01:00
Luca Boccassi
9a6e10406d Problem: too many CI builds
Solution: remove libsodium and no curve builds from cmake and android
2016-02-12 23:22:51 +00:00
Luca Boccassi
930a24425c Merge pull request #1802 from hintjens/master
Problem: tests don't build on Windows
2016-02-12 15:28:09 +00:00
Pieter Hintjens
9c0d176d68 Problem: tests don't build on Windows
There were numerous small issues with test cases:

- some lacked the right source file header
- some were not portable at all
- some were using internal libzmq APIs (headers)

Solution: fixed and cleaned up.
2016-02-12 16:12:44 +01:00
Luca Boccassi
0dbb918244 Merge pull request #1800 from hintjens/master
Cleaning up Windows build for gyp
2016-02-12 15:00:24 +00:00
Pieter Hintjens
bbcc79d188 Problem: tests don't build on Windows
There were numerous small issues with test cases:

- some lacked the right source file header
- some were not portable at all
- some were using internal libzmq APIs (headers)

Solution: fixed and cleaned up.
2016-02-12 15:48:37 +01:00
Pieter Hintjens
06acd76a21 Problem: people don't know how to write test cases
Solution: document the minimum rules in README.md
2016-02-12 15:48:37 +01:00
Pieter Hintjens
d148c3ea5d Problem: no clue how to run gyp on Windows
Solution: offer a build.bat to help the user.
2016-02-12 15:48:37 +01:00
Luca Boccassi
8bee4e2547 Merge pull request #1799 from hintjens/master
Making gyp builds work
2016-02-12 10:40:43 +00:00
Pieter Hintjens
8230c0d396 Problem: gyp does not build tests
Solution: it's a lot of work to define the tests in project.gyp
so I did this using gsl to generate the JSON, from a small XML
list of the test cases.

To keep this, and the hundreds of .mk files, away from the root
directory, I've moved the gyp files into builds/gyp, where you
would run them.

It all seems to work now. Next up, OS/X and Windows :)
2016-02-12 11:31:38 +01:00
Pieter Hintjens
44c3859073 Problem: minor glitch, test_socketopt_hwm <> test_sockopt_hwm
Doesn't affect building, just potentially confusing.

Solution: fix it.
2016-02-12 11:24:35 +01:00
Pieter Hintjens
25ce52e449 Problem: tcp_address.cpp has messy include usage
It's all over the place.

Solution: remove duplicates and try to move main includes to start
of source. Also, include net/if.h always, so that the code will
compile if ZMQ_HAVE_IFADDRS isn't defined.
2016-02-12 11:01:52 +01:00
Pieter Hintjens
a682f94a32 Problem: tcp_address.cpp won't compile on OS/X w/o ZMQ_HAVE_IFADDRS
This is rather insane since the code knows well enough what systems
support if_nametoindex. I blame this on over-use of autotools early
in libzmq's days.

Anyhow, this breaks gyp builds on OS/X.

Solution: add ZMQ_HAVE_IFADDRS to build/gyp/platform.hpp for OS/X.
2016-02-12 10:49:19 +01:00
Constantin Rack
22e830bece Merge pull request #1798 from hintjens/master
Getting gyp build working
2016-02-12 10:07:14 +01:00
Pieter Hintjens
6bef3fe9ad Problem: can't build libzmq.a using gyp
Solution: add necessary macros into builds/gyp/platform.hpp

Work for Linux now, other platforms to test.
2016-02-12 09:58:44 +01:00
Joe Eli McIlvain
781ddd6758 Merge pull request #1797 from bluca/ci_matrix
Problem: CI use of sodium or nacl is confusing
2016-02-11 15:31:21 -08:00
Luca Boccassi
9393f06381 Problem: CI use of sodium or nacl is confusing
Solution: establish a matrix of CI options. On one axis we have the
build system (autotools, cmake, android) and on the other axis we
have the encryption options (tweetnacl, libsodium or none).
2016-02-11 22:39:36 +00:00
Pieter Hintjens
05f382d290 Merge pull request #1796 from bluca/cmake_build
Problem: typo in CMake platform.hpp breaks build
2016-02-11 23:06:07 +01:00
Luca Boccassi
01eb580739 Problem: typo in CMake platform.hpp breaks build
Solution: use ZMQ_USE_TWEETNACL as a define as expected instead of
HAVE_TWEETNACL
2016-02-11 21:41:21 +00:00
Pieter Hintjens
fde81d7e07 Problem: can't build using gyp
I'm adding gyp support so that we can easily pull in libzmq
and other C/C++ projects into gyp packages, especially via
node-gyp.

Solution: add gyp definition

This works only for Windows, OS/X, and Linux. We set a single
macro in project.gyp according to the system, and the rest is
done in builds/gyp/platform.hpp. The values in that file are
not dynamic. Your mileage will vary.
2016-02-11 22:41:01 +01:00
Pieter Hintjens
db77fc9ced Merge pull request #1795 from bluca/ci_tweetnacl
Problem: CI is borken
2016-02-11 22:18:52 +01:00
Luca Boccassi
0afac59018 Problem: empty files are against ISO C++
Solution: if not building with tweetnacl, do not include its sources
in Makefile.am. CMake already includes them optionally.
2016-02-11 21:05:10 +00:00
Luca Boccassi
f1c4416e20 Problem: typo in CMakeLists "matches" keyword
Solution: must be upper case
2016-02-11 20:41:18 +00:00
Luca Boccassi
1e6915039f Problem: typo in CMakeLists.txt, can't use sodium
Solution: check for WITH_LIBSODIUM configure option instead of
WITH_SODIUM
2016-02-11 20:40:34 +00:00
Luca Boccassi
f777ad8b91 Problem: typo in configure.ac, can't use libsodium
Solution: set the curve_library variable to the expected value if
libsodium is selected
2016-02-11 20:30:07 +00:00
Luca Boccassi
0bdc5d0457 Problem: CMake CI build still clones libsodium
Solution: avoid cloning libsodium, default build is tweetnacl
2016-02-11 20:27:06 +00:00
Luca Boccassi
4f5594c2ce Problem: Android CI build uses unstable libsodium
Solution: checkout stable branch before building
2016-02-11 20:25:21 +00:00
Luca Boccassi
3420e6e0dd Problem: CI still thinks libsodium is default
Solution: build by default with tweetnacl, and add sub-build project
to test libsodium
2016-02-11 20:16:17 +00:00
Luca Boccassi
1fb4840955 Merge pull request #1794 from hintjens/master
Problem: tweetnacl sources are a mess
2016-02-11 17:19:16 +00:00