1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-29 22:28:02 +02:00

Only run test-level stack trace by default for unit-tested modules.

This amends 70c30dfb which disabled test tracing in general.

Instead, only enable test tracing by default for modules that are being unit tested. This saves lots of time but still ensures that test tracing is working and helps with debugging in unit tests.

Also rename the option to --debug-test-trace for a clarity.
This commit is contained in:
David Steele
2019-02-27 17:09:19 +02:00
parent 3a05359087
commit 18b62a4220
5 changed files with 12 additions and 11 deletions

View File

@@ -74,7 +74,7 @@ sub new
$self->{bBackTrace},
$self->{bProfile},
$self->{bDebug},
$self->{bDebugTrace},
$self->{bDebugTestTrace},
) =
logDebugParam
(
@@ -102,7 +102,7 @@ sub new
{name => 'bBackTrace'},
{name => 'bProfile'},
{name => 'bDebug'},
{name => 'bDebugTrace'},
{name => 'bDebugTestTrace'},
);
# Set try to 0
@@ -391,7 +391,7 @@ sub run
($self->{oTest}->{&TEST_DEBUG_UNIT_SUPPRESS} ? '' : " -DDEBUG_UNIT") .
(vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? ' -DWITH_BACKTRACE' : '') .
($self->{oTest}->{&TEST_CDEF} ? " $self->{oTest}->{&TEST_CDEF}" : '') .
($self->{bDebug} ? '' : ' -DNDEBUG') . ($self->{bDebugTrace} ? ' -DDEBUG_TRACE' : '');
($self->{bDebug} ? '' : ' -DNDEBUG') . ($self->{bDebugTestTrace} ? ' -DDEBUG_TEST_TRACE' : '');
# Flags used to buid harness files
my $strHarnessFlags =
@@ -404,6 +404,7 @@ sub run
my $strTestFlags =
'-Werror -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wconversion -Wformat=2' .
' -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith -Wvla' .
' -DDEBUG_TEST_TRACE' .
($self->{oTest}->{&TEST_VM} eq VM_U16 || $self->{oTest}->{&TEST_VM} eq VM_U18 ?
' -Wformat-signedness' : '') .
($self->{oTest}->{&TEST_VM} eq VM_U18 ?