67 Commits

Author SHA1 Message Date
Joakim Soderberg
f7805939d1 Only look for ZLib when it is used (if tests are included).
Also make the project language C.
2013-12-19 10:46:04 +00:00
Joakim Soderberg
4ac086abc4 Fix the "make verify" target on NetBSD 2013-12-19 10:54:52 +01:00
Joakim Soderberg
f2483f8b3d Add a "make verify_coverage" target generation coverage info.
Use lcov/gcov to gather coverage info for the tests (Only works with gcc/clang and make).

cmake -DEVENT__COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug ..
make
make verify_coverage

Current coverage (run on debian):
Line coverage 79.1 %	10231 / 12939
Function coverage 86.1 %	933 / 1083
2013-12-17 15:17:29 +00:00
Joakim Soderberg
968e97bd4b Minimum required python version is 2.4.
Got rid of TODO... The version you specify to find_package is the minimum
version, so exactly what we want.
2013-12-17 14:31:22 +01:00
Joakim Söderberg
2799b359d3 Added a test for testing if kqueue works with pipes. 2013-12-17 14:01:21 +01:00
Joakim Söderberg
a831f2f7de Fix kqueue support. 2013-12-17 13:29:04 +01:00
Joakim Söderberg
69c3516be6 Get rid of deprecation warnings for OpenSSL on OSX 10.7+ 2013-12-17 13:28:23 +01:00
Joakim Soderberg
67e5d74983 Fix the make "verify" target on Windows.
Windows does not have the "unset" command, but this doesn't matter since
the problem that requires us to use unset doesn't happen on Windows.

Also did some minor cosmetic changes, and dependcy changes.
2013-12-16 18:10:32 +01:00
Joakim Soderberg
e053c4f029 Added a "make verify" target.
This is more than for cosmetic purposes to match how it's done with autoconf.

Due to the fact that we use environment variables to turn off certain backends during the tests, simply running "ctest" or "make test" can result in failed tests.

This is because if you do "EVENT_NOEPOLL=yes && export EVENT_NOEPOLL" and then run the tests, when running the epoll tests, the EPOLL backend will be turned off. There is no way of unsetting an environment variable for a test in CMake, you can only set them. And since libevent simply checks if the environment variable is set (it doesn't check the actual value of it), this won't work.

So to remedy this, we create the "make verify" target that first unsets all the EVENT_NO* environment variables, and then runs ctest.

Also bumped the required CMake version from 2.6 to 2.8, since the set_test_properties(bla PROPERTIES ENVIRONMENT "SOME_VAR") requires 2.8

Added some explicit dependencies for the test programs to libevent, so they don't just fail if you try to run the tests without first doing "make"
2013-12-16 16:44:13 +00:00
Joakim Soderberg
7ea4159d29 Only test the event backends available on the system.
Fix how the CMake project adds the tests using the different backends. At
first we tried to do it exactly as it's done in test/test.sh.

However, test.sh uses a special program test-init to decide if a given
backend is available or not before running the actual tests. Doing it this way
will not be possible using CMake. Since then we would have to have the
test-init executable compiled at the time we run CMake, to know what tests
we should add. (And since CMake generates the make/project files that
compiles the executables, there's a catch 22).

Instead of deciding what tests to run this way, we simply use the result
of the CMake system introspection (that figures out what backends are
available) to decide what backend tests to add.
2013-12-16 16:37:51 +01:00
Joakim Soderberg
9bbce0b63c Only include WIN32 getopt where it is used.
getopt is only used in the benchmark tests, don't include it in the core
lib...
2013-12-16 11:34:14 +01:00
Joakim Soderberg
19222e5247 Added some GCC specific options.
- Added sample applications.
- Fixed the https-client to work on Windows kind of (No cert validation).
2013-12-13 16:27:10 +00:00
Joakim Soderberg
58fcd42880 Link libm on unix platforms. 2013-12-13 12:39:50 +00:00
Joakim Soderberg
ce14defeb6 Generate a dummy evconfig-private.h so things build properly.
Windows used to have an empty file for this before.
2013-12-13 13:33:43 +01:00
Joakim Soderberg
99c1dc3233 More work on adding tests to CMake project 2013-12-12 18:21:11 +01:00
Joakim Soderberg
e9fc014c86 Add all tests and benchmarks to CMake project.
Also fixed some minor issues with what's built.
2013-12-12 16:33:20 +01:00
Joakim Soderberg
e415196a7d Initial CMake commit. 2013-12-09 18:05:32 +01:00