Improved mpt default timeout.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
This commit is contained in:
		
							parent
							
								
									955f933ae2
								
							
						
					
					
						commit
						289322a33d
					
				
					 6 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
					@ -16,6 +16,7 @@ option(MPT_ENABLE_SELFTEST "Enable multi-process test-framework self test" OFF)
 | 
				
			||||||
set(MPT_CMAKE "${CMAKE_CURRENT_SOURCE_DIR}/mpt/cmake/MPT.cmake")
 | 
					set(MPT_CMAKE "${CMAKE_CURRENT_SOURCE_DIR}/mpt/cmake/MPT.cmake")
 | 
				
			||||||
set(MPT_SOURCE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 | 
					set(MPT_SOURCE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 | 
				
			||||||
set(MPT_BINARY_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
 | 
					set(MPT_BINARY_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
 | 
				
			||||||
 | 
					set(MPT_DEFAULT_TIMEOUT "60")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory(mpt)
 | 
					add_subdirectory(mpt)
 | 
				
			||||||
add_subdirectory(tests)
 | 
					add_subdirectory(tests)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,6 @@
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
set(MPT_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
 | 
					set(MPT_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function(parse_mpt_fixtures INPUT TEST_DISABLED TEST_TIMEOUT TEST_XFAIL)
 | 
					function(parse_mpt_fixtures INPUT TEST_DISABLED TEST_TIMEOUT TEST_XFAIL)
 | 
				
			||||||
  set(s "[ \t\r\n]")
 | 
					  set(s "[ \t\r\n]")
 | 
				
			||||||
  if(INPUT MATCHES ".disabled${s}*=${s}*([tT][rR][uU][eE]|[0-9]+)")
 | 
					  if(INPUT MATCHES ".disabled${s}*=${s}*([tT][rR][uU][eE]|[0-9]+)")
 | 
				
			||||||
| 
						 | 
					@ -24,7 +22,7 @@ function(parse_mpt_fixtures INPUT TEST_DISABLED TEST_TIMEOUT TEST_XFAIL)
 | 
				
			||||||
  if(INPUT MATCHES ".timeout${s}*=${s}*([0-9]+)")
 | 
					  if(INPUT MATCHES ".timeout${s}*=${s}*([0-9]+)")
 | 
				
			||||||
    set(${TEST_TIMEOUT} "${CMAKE_MATCH_1}" PARENT_SCOPE)
 | 
					    set(${TEST_TIMEOUT} "${CMAKE_MATCH_1}" PARENT_SCOPE)
 | 
				
			||||||
  else()
 | 
					  else()
 | 
				
			||||||
    set(${TEST_TIMEOUT} "0" PARENT_SCOPE)
 | 
					    set(${TEST_TIMEOUT} "${MPT_DEFAULT_TIMEOUT}" PARENT_SCOPE)
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(INPUT MATCHES ".xfail${s}*=${s}*([tT][rR][uU][eE]|[0-9]+)")
 | 
					  if(INPUT MATCHES ".xfail${s}*=${s}*([tT][rR][uU][eE]|[0-9]+)")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -154,5 +154,4 @@ MPT_TestFiniDeclaration(suite, test)                              \
 | 
				
			||||||
/* Helpful function to check for patterns in log callbacks. */
 | 
					/* Helpful function to check for patterns in log callbacks. */
 | 
				
			||||||
int mpt_patmatch(const char *pat, const char *str);
 | 
					int mpt_patmatch(const char *pat, const char *str);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif /* MPT_H_INCLUDED */
 | 
					#endif /* MPT_H_INCLUDED */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,5 +2,6 @@
 | 
				
			||||||
#define MPT_RESOURCE_H_INCLUDED
 | 
					#define MPT_RESOURCE_H_INCLUDED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MPT_SOURCE_ROOT_DIR "@MPT_SOURCE_ROOT_DIR@"
 | 
					#define MPT_SOURCE_ROOT_DIR "@MPT_SOURCE_ROOT_DIR@"
 | 
				
			||||||
 | 
					#define MPT_DEFAULT_TIMEOUT (@MPT_DEFAULT_TIMEOUT@) /* Seconds. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* MPT_RESOURCE_H_INCLUDED */
 | 
					#endif /* MPT_RESOURCE_H_INCLUDED */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -157,10 +157,9 @@ mpt_test_new(const char* name, int secs, bool xf)
 | 
				
			||||||
   * So, make sure that the 'manual' timeout takes longer than the ctest
 | 
					   * So, make sure that the 'manual' timeout takes longer than the ctest
 | 
				
			||||||
   * timeout. */
 | 
					   * timeout. */
 | 
				
			||||||
  if (secs == 0) {
 | 
					  if (secs == 0) {
 | 
				
			||||||
    test->timeout = DDS_SECS(1600);
 | 
					    secs = MPT_DEFAULT_TIMEOUT;
 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    test->timeout = DDS_SECS(secs * 2);
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  test->timeout = DDS_SECS(secs + 5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return test;
 | 
					  return test;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,3 +70,6 @@ MPT_Test(disabled, _false, .disabled=false);
 | 
				
			||||||
 * This can only really be done manually, unfortunately. */
 | 
					 * This can only really be done manually, unfortunately. */
 | 
				
			||||||
MPT_TestProcess(timeout, child_culling, id, proc_sleep, MPT_ArgValues(DDS_SECS(120)));
 | 
					MPT_TestProcess(timeout, child_culling, id, proc_sleep, MPT_ArgValues(DDS_SECS(120)));
 | 
				
			||||||
MPT_Test(timeout, child_culling, .timeout=1);
 | 
					MPT_Test(timeout, child_culling, .timeout=1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MPT_TestProcess(timeout, default_timeout, id, proc_sleep, MPT_ArgValues(DDS_SECS(120)));
 | 
				
			||||||
 | 
					MPT_Test(timeout, default_timeout);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue