Skip to content

Commit

Permalink
Enable backtraces and timestamps in all tests when building with CMake
Browse files Browse the repository at this point in the history
(cherry picked from commit 166e39c)
  • Loading branch information
qris committed Jul 6, 2017
1 parent 035837b commit db3e4c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion infrastructure/cmake/CMakeLists.txt
Expand Up @@ -288,7 +288,8 @@ foreach(module_dep ${module_deps})
-DTEST_EXECUTABLE="${test_command_internal}")
add_test(NAME ${test_name}
COMMAND ${PERL_EXECUTABLE} ${base_dir}/runtest.pl
${appveyor_runtest_pl_switch} -c ${test_name}
${appveyor_runtest_pl_switch}
-cT$<$<CONFIG:Debug>:O-LBackupFileSystem.cpp=trace> ${test_name}
$<$<CONFIG:Debug>:DEBUG>$<$<CONFIG:Release>:RELEASE>$<$<CONFIG:RelWithDebInfo>:RELEASE>
"$<TARGET_FILE:${module_name}>" "${test_command_internal}"
WORKING_DIRECTORY ${base_dir})
Expand Down
15 changes: 9 additions & 6 deletions runtest.pl.in
Expand Up @@ -14,13 +14,15 @@ use lib dirname($0)."/infrastructure";
use BoxPlatform;

my %opts;
getopts('acnv', \%opts);
getopts('acnTO:v', \%opts);

# Don't actually run the test, just prepare for it.
my $appveyor_mode = $opts{'a'};
my $cmake_build = $opts{'c'};
my $prepare_only = $opts{'n'};
my $timestamp_tests = $opts{'T'};
my $extra_options = $opts{'O'} || '';
my $verbose_build = $opts{'v'};
my $appveyor_mode = $opts{'a'};

my $test_name = shift @ARGV;
my $test_mode = shift @ARGV;
Expand Down Expand Up @@ -187,7 +189,7 @@ sub runtest
);

# Our CMake buildsystem doesn't do anything to support testextra files
# (Makfile syntax), so fake it.
# (Makefile syntax), so fake it.
if (-r "$test_src_dir/testextra")
{
open EXTRA, "$test_src_dir/testextra"
Expand Down Expand Up @@ -245,16 +247,17 @@ sub runtest
return;
}

my $logfile = "test-$t.log";
my $test_res;

if($prepare_only)
{
appveyor_test_status($t, "Skipped", time() - $start_time,
"we are only preparing this test");
return;
}

my $test_res;
my $logfile = "test-$t.log";
my $test_options = ($timestamp_tests ? "-T" : "")." ".$extra_options;

# run it
if($cmake_build)
{
Expand Down

0 comments on commit db3e4c5

Please sign in to comment.