109 Commits

Author SHA1 Message Date
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