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.
This commit is contained in:
Joakim Soderberg 2013-12-16 18:10:32 +01:00
parent e053c4f029
commit 67e5d74983

View File

@ -739,8 +739,10 @@ if (NOT EVENT__DISABLE_TESTS)
test-time
test-weof)
set(ALL_TESTPROGS ${TESTPROGS} test-dumpevents test-ratelim)
# Create test program executables.
foreach (TESTPROG ${TESTPROGS} test-dumpevents test-ratelim)
foreach (TESTPROG ${ALL_TESTPROGS})
add_executable(${TESTPROG} test/${TESTPROG}.c)
target_link_libraries(${TESTPROG} event ${LIB_PLATFORM})
add_dependencies(${TESTPROG} event)
@ -843,22 +845,28 @@ if (NOT EVENT__DISABLE_TESTS)
#
# Group limits, no connection limit.
add_test(test-ratelim_group_lim ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -g 30000 -n 30 -t 100 --check-grouplimit 1000 --check-stddev 100)
add_test(test-ratelim__group_lim ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -g 30000 -n 30 -t 100 --check-grouplimit 1000 --check-stddev 100)
# Connection limit, no group limit.
add_test(test-ratelim_con_lim ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -c 1000 -n 30 -t 100 --check-connlimit 50 --check-stddev 50)
add_test(test-ratelim__con_lim ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -c 1000 -n 30 -t 100 --check-connlimit 50 --check-stddev 50)
# Connection limit and group limit.
add_test(test-ratelim_group_con_lim ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -c 1000 -g 30000 -n 30 -t 100 --check-grouplimit 1000 --check-connlimit 50 --check-stddev 50)
add_test(test-ratelim__group_con_lim ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -c 1000 -g 30000 -n 30 -t 100 --check-grouplimit 1000 --check-connlimit 50 --check-stddev 50)
# Connection limit and group limit with independent drain.
add_test(test-ratelim_group_con_lim_drain ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -c 1000 -g 35000 -n 30 -t 100 -G 500 --check-grouplimit 1000 --check-connlimit 50 --check-stddev 50)
add_test(test-ratelim__group_con_lim_drain ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim -c 1000 -g 35000 -n 30 -t 100 -G 500 --check-grouplimit 1000 --check-connlimit 50 --check-stddev 50)
# Add a "make verify" target, same as for autoconf.
# (Important! This will unset all EVENT_NO* environment variables.
# If they are set in the shell the tests are running using simply "ctest" or "make test" will fail)
if (WIN32)
# Windows doesn't have "unset", and the above does not happen anyway.
add_custom_target(verify COMMAND ${CMAKE_CTEST_COMMAND}
DEPENDS event ${ALL_TESTPROGS})
else()
add_custom_target(verify COMMAND unset EVENT_NOEPOLL && unset EVENT_NOPOLL && unset EVENT_NOSELECT && unset EVENT_NOWIN32 && unset EVENT_NOEVPORT && unset EVENT_NOKQUEUE && unset EVENT_NODEVPOLL && ${CMAKE_CTEST_COMMAND}
DEPENDS event ${TESTPROGS})
DEPENDS event ${ALL_TESTPROGS})
endif()
if (NOT EVENT__DISABLE_REGRESS)
add_dependencies(verify regress)