pgbackrest.git / summary / log / commit / refs

commit    5dfdd6dd5b7b43dc3a223b9552aed4052d0db3aa
Author:   David Steele <david@pgmasters.net>
Date:     Tue Oct 19 16:45:20 2021 +0000

    Add -Werror -Wfatal-errors -g flags to configure --enable-test.
    
    These flags are used for all tests but it was not possible to add them to configure before the change in 046d6643. This is especially important for adhoc tests to ensure the flags are not forgotten.
    
    Remove the flags from test make commands where they were being applied.
    
    There is no change for production builds.


src/build/configure.ac | 6 ++++++ src/configure | 10 +++++++++- test/lib/pgBackRestTest/Common/JobTest.pm | 3 +-- test/test.pl | 3 +-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/build/configure.ac b/src/build/configure.ac index 6ae9c15c1..a536f316f 100644 --- a/src/build/configure.ac +++ b/src/build/configure.ac @@ -161,6 +161,12 @@ else # Add additional warnings AC_SUBST(CFLAGS, "${CFLAGS} -Wwrite-strings -Wconversion -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith") AC_SUBST(CFLAGS, "${CFLAGS} -Wvla") + + # Add error on warnings and stop on first error + AC_SUBST(CFLAGS, "${CFLAGS} -Werror -Wfatal-errors") + + # Add debug info + AC_SUBST(CFLAGS, "${CFLAGS} -g") fi # Write output diff --git a/src/configure b/src/configure index 5eba7aa03..99867daec 100755 --- a/src/configure +++ b/src/configure @@ -4384,6 +4384,14 @@ fi CFLAGS="${CFLAGS} -Wvla" + + # Add error on warnings and stop on first error + CFLAGS="${CFLAGS} -Werror -Wfatal-errors" + + + # Add debug info + CFLAGS="${CFLAGS} -g" + fi # Write output @@ -5664,4 +5672,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -# Generated from src/build/configure.ac sha1 999f26c80409188dd6ae0d2e9fed7e56d765b056 +# Generated from src/build/configure.ac sha1 b69b4dba61cbc695a6e947f8415d430163db8821 diff --git a/test/lib/pgBackRestTest/Common/JobTest.pm b/test/lib/pgBackRestTest/Common/JobTest.pm index 42f67c58f..8a2817f7d 100644 --- a/test/lib/pgBackRestTest/Common/JobTest.pm +++ b/test/lib/pgBackRestTest/Common/JobTest.pm @@ -289,7 +289,7 @@ sub run # Generate Makefile.param my $strMakefileParam = "CFLAGS =" . - " \\\n\t-Werror -Wfatal-errors -g" . + " \\\n\t-DERROR_MESSAGE_BUFFER_SIZE=131072" . ($self->{bProfile} ? " \\\n\t-pg" : '') . (vmArchBits($self->{oTest}->{&TEST_VM}) == 32 ? " \\\n\t-D_FILE_OFFSET_BITS=64" : '') . ($self->{bDebug} ? '' : " \\\n\t-DNDEBUG") . @@ -298,7 +298,6 @@ sub run ($self->{bDebugTestTrace} && $self->{bDebug} ? " \\\n\t-DDEBUG_TEST_TRACE" : '') . (vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? " \\\n\t-DWITH_BACKTRACE" : '') . ($self->{oTest}->{&TEST_CDEF} ? " \\\n\t$self->{oTest}->{&TEST_CDEF}" : '') . - " -DERROR_MESSAGE_BUFFER_SIZE=131072\n" . "\n" . "\n" . "CFLAGS_TEST =" . diff --git a/test/test.pl b/test/test.pl index 2ac7ac93c..07350fbcc 100755 --- a/test/test.pl +++ b/test/test.pl @@ -531,7 +531,7 @@ eval &log(INFO, "autogenerate code"); # Build code - executeTest("CFLAGS='-Wfatal-errors -g' make -C ${strBuildPath} build-config build-error build-help"); + executeTest("make -C ${strBuildPath} build-config build-error build-help"); if ($bGenOnly) { @@ -693,7 +693,6 @@ eval # Build configure/compile options and see if they have changed from the previous build my $strCFlags = - "-Wfatal-errors -g" . (vmWithBackTrace($strBuildVM) && $bBackTrace ? ' -DWITH_BACKTRACE' : '') . ($bDebugTestTrace ? ' -DDEBUG_TEST_TRACE' : ''); my $strLdFlags = vmWithBackTrace($strBuildVM) && $bBackTrace ? '-lbacktrace' : ''; [parent: 046d66433738]