diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2018-09-17 15:58:55 -0400 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2018-10-10 16:23:56 -0400 |
commit | 8ecfd7bd4acd69213c06fac6de9af38299123547 (patch) | |
tree | 2c3055edaaac0053f0403713cbbbbe5e6a01c4b3 /gdb/configure | |
parent | 33b031ce7a9b8b1b7c729518af965b7cb70a1cd6 (diff) | |
download | gdb-8ecfd7bd4acd69213c06fac6de9af38299123547.zip gdb-8ecfd7bd4acd69213c06fac6de9af38299123547.tar.gz gdb-8ecfd7bd4acd69213c06fac6de9af38299123547.tar.bz2 |
Add parameter to allow enabling/disabling selftests via configure
This is a follow-up of:
https://sourceware.org/ml/gdb-patches/2018-08/msg00347.html
Instead of going throttle and always enabling our selftests (even in
non-development builds), this patch is a bit more conservative and
introduces a configure option ("--enable-unit-tests") that allows the
user to choose whether she wants unit tests in the build or not. Note
that the current behaviour is retained: if no option is provided, GDB
will have selftests included in a development build, and will *not*
have selftests included in a non-development build.
The rationale for having this option is still the same: due to the
many racy testcases and random failures we see when running the GDB
testsuite, it is unfortunately not possible to perform a full test
when one is building a downstream package. As the Fedora GDB
maintainer and one of the Debian GDB uploaders, I feel like this
situation could be improved by, at least, executing our selftests
after the package has been built.
This patch introduces no regressions to our build.
OK?
gdb/ChangeLog:
2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
Simon Marchi <simark@simark.ca>
* README (`configure' options): Add documentation for new
"--enable-unit-tests" option.
* acinclude.m4: Include "selftest.m4".
* configure: Regenerate.
* configure.ac: Use "GDB_AC_SELFTEST".
* maint.c (maintenance_selftest): Update message informing
that selftests have been disabled.
(maintenance_info_selftests): Likewise.
* selftest.m4: New file.
gdb/gdbserver/ChangeLog:
2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
Simon Marchi <simark@simark.ca>
* acinclude.m4: Include "../selftest.m4".
* configure: Regenerate.
* configure.ac: Use "GDB_AC_SELFTEST".
* configure.srv: Use "$enable_unittests" instead of
"$development" when checking whether unit tests have been
enabled.
* server.c (captured_main): Update message informing that
selftests have been disabled.
gdb/testsuite/ChangeLog:
2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.gdb/unittest.exp: Update expected message informing that
selftests have been disabled.
* gdb.server/unittest.exp: Likewise.
squash! Add parameter to allow enabling/disabling selftests via configure
Diffstat (limited to 'gdb/configure')
-rwxr-xr-x | gdb/configure | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gdb/configure b/gdb/configure index adb26e5..3652455 100755 --- a/gdb/configure +++ b/gdb/configure @@ -896,6 +896,7 @@ enable_sim enable_gdbserver with_babeltrace with_libbabeltrace_prefix +enable_unit_tests ' ac_precious_vars='build_alias host_alias @@ -1561,6 +1562,8 @@ Optional Features: --enable-sim link gdb with simulator --enable-gdbserver automatically build gdbserver (yes/no/auto, default is auto) + --enable-unit-tests Enable the inclusion of unit tests when compiling + GDB Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -17838,15 +17841,37 @@ ac_config_links="$ac_config_links $ac_config_links_1" $as_echo "#define GDB_DEFAULT_HOST_CHARSET \"UTF-8\"" >>confdefs.h -if $development; then + +# Check whether we will enable the inclusion of unit tests when +# compiling GDB. +# +# The default value of this option changes depending whether we're on +# development mode (in which case it's "true") or not (in which case +# it's "false"). +# Check whether --enable-unit-tests was given. +if test "${enable_unit_tests+set}" = set; then : + enableval=$enable_unit_tests; case "${enableval}" in + yes) enable_unittests=true ;; + no) enable_unittests=false ;; + *) as_fn_error $? "bad value ${enableval} for --{enable,disable}-unit-tests option" "$LINENO" 5 ;; +esac +else + enable_unittests=$development +fi + + +if $enable_unittests; then $as_echo "#define GDB_SELF_TEST 1" >>confdefs.h + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) common/selftest.o selftest-arch.o" CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) common/selftest.c selftest-arch.c" + fi + gdb_ac_transform=`echo "$program_transform_name" | sed -e 's/\\$\\$/\\$/g'` GDB_TRANSFORM_NAME=`echo gdb | sed -e "$gdb_ac_transform"` if test "x$GDB_TRANSFORM_NAME" = x; then |