Commit 906c2cae authored by James Johnston's avatar James Johnston Committed by Brad King

Process: Added test cases for testing Ctrl+C and process groups.

Two new tests were added to testProcess:
 * Test 9 is constructed of the root test process, a child process,
   and a grandchild process.  The grandchild ignores all Ctrl+C signals
   and then sleeps.  The child runs the grandchild normally.  The root
   process runs the child in a new process group, sends it a Ctrl+C
   signal, and then lets the process expire to prove that the child was
   blocked waiting for the uninterruptable grandchild to die.
 * Test 10 is constructed of the root test process, a child process,
   and a grandchild process.  The grandchild sleeps and processes
   signals normally.  The child runs the grandchild in a new process
   group.  The root process runs the child in a new process group as
   well, sends it a Ctrl+C, and then verifies that: (1) the child does
   indeed terminate with an interrupt signal, (2) the child did not
   expire, proving that it retransmitted the signal to the sleeping
   grandchild before waiting for the grandchild to terminate.

Change-Id: Iba5bee546a82eb61a41d4194341e9382a00279d4
parent ef517b19
......@@ -1237,7 +1237,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
IF(NOT CYGWIN)
SET(KWSYS_TEST_PROCESS_7 7)
ENDIF()
FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7})
FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7} 9 10)
ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n})
SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120)
......@@ -1270,6 +1270,10 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
ENDIF()
# Set up ctest custom configuration file.
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/CTestCustom.cmake.in
${PROJECT_BINARY_DIR}/CTestCustom.cmake @ONLY)
# Suppress known consistent failures on buggy systems.
IF(KWSYS_TEST_BOGUS_FAILURES)
SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON)
......
# kwsys.testProcess-10 involves sending SIGINT to a child process, which then
# exits abnormally via a call to _exit(). (On Windows, a call to ExitProcess).
# Naturally, this results in plenty of memory being "leaked" by this child
# process - the memory check results are not meaningful in this case.
#
# kwsys.testProcess-9 also tests sending SIGINT to a child process. However,
# normal operation of that test involves the child process timing out, and the
# host process kills (SIGKILL) it as a result. Since it was SIGKILL'ed, the
# resulting memory leaks are not logged by valgrind anyway. Therefore, we
# don't have to exclude it.
set(CTEST_CUSTOM_MEMCHECK_IGNORE
${CTEST_CUSTOM_MEMCHECK_IGNORE}
kwsys.testProcess-10
)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment