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 d22f8e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -23,6 +23,7 @@ addons:
- libreadline-dev
- libssl-dev
- libwww-perl
- time
- xsltproc
- zlib1g-dev
- libboost-dev
Expand Down
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
6 changes: 4 additions & 2 deletions runtest.pl.in
Expand Up @@ -279,9 +279,11 @@ 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 " .
"| tee ../../../$logfile");
$test_res = system("cd $test_mode/test/$t; ".
"$time_test_command_prefix sh -c "
"'sh t 2>&1 | tee ../../../$logfile'");
}

# open test results
Expand Down

0 comments on commit d22f8e7

Please sign in to comment.