Skip to content

Commit

Permalink
Time test commands, to debug test timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
qris committed Feb 21, 2017
1 parent 7614e85 commit 349394e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion infrastructure/cmake/CMakeLists.txt
Expand Up @@ -181,6 +181,12 @@ set(testmain_template_cpp
"${base_dir}/infrastructure/buildenv-testmain-template.cpp"
)

if(WIN32)
set(time_test_command_prefix "")
else()
set(time_test_command_prefix "/usr/bin/time")
endif()

file(STRINGS ${base_dir}/modules.txt module_deps REGEX "^[^#]")
foreach(module_dep ${module_deps})

Expand Down Expand Up @@ -273,7 +279,8 @@ foreach(module_dep ${module_deps})
target_compile_definitions(${module_name} PRIVATE
-DTEST_EXECUTABLE="${test_executable}")
add_test(NAME ${test_name}
COMMAND ${PERL_EXECUTABLE} ${base_dir}/runtest.pl
COMMAND ${time_test_command_prefix}
${PERL_EXECUTABLE} ${base_dir}/runtest.pl
${appveyor_runtest_pl_switch} -c ${test_name}
$<CONFIG> "$<TARGET_FILE:${module_name}>" "${test_executable}"
WORKING_DIRECTORY ${base_dir})
Expand Down
4 changes: 3 additions & 1 deletion runtest.pl.in
Expand Up @@ -279,8 +279,10 @@ sub runtest
}
else
{
my $time_test_command_prefix = $target_windows ? "" : "/usr/bin/time";
chdir($base_dir);
$test_res = system("cd $test_mode/test/$t ; sh t 2>&1 " .
$test_res = system("cd $test_mode/test/$t; ".
"$time_test_command_prefix sh t 2>&1 " .
"| tee ../../../$logfile");
}

Expand Down

0 comments on commit 349394e

Please sign in to comment.