[systemd-devel] [PATCH v3] buildsys: Add --disable-tests to avoid building tests
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Wed Apr 17 10:53:38 PDT 2013
On Wed, Apr 17, 2013 at 07:36:47PM +0200, Henrik Grindal Bakken wrote:
> This patch adds --disable-tests to configure. It is based on a patch
> posted by Thierry Reding in 2010. The motivation for adding it is that
> some tests fail link-time when cross-compiling.
>
> The patch adds a new Makefile variable -- noinst_test_programs -- and uses
> that instead of noinst_PROGRAMS. However, if ENABLE_TESTS is true,
> the former is added to the latter.
> ---
> Makefile.am | 18 ++++++++++++------
> configure.ac | 5 +++++
> 2 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 7b4b2d8..89b95ba 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -125,8 +125,14 @@ dist_dbussystemservice_DATA =
> check_PROGRAMS =
> check_DATA =
> noinst_tests=
> -noinst_PROGRAMS = $(noinst_tests)
> +noinst_test_programs =
> +if ENABLE_TESTS
> +noinst_PROGRAMS = $(noinst_test_programs) $(noinst_tests)
> TESTS = $(noinst_tests)
> +else
> +noinst_PROGRAMS =
> +TESTS =
> +endif
> udevlibexec_PROGRAMS =
Hm, maybe rename noinst_test_programs to 'manual_tests', and
noinst_tests to just 'tests'. noinst_ is just for automake. This way
it'll be clearer that 'manual_tests' are tests that are not run
automatically.
> +AC_ARG_ENABLE(tests,
> + [AC_HELP_STRING([--disable-tests], [build tests])],
> + enable_tests=$enableval, enable_tests=yes)
> +AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
> +
Are you sure that this is enabled by default? The docstring seems
to be opposite of the actual meaning.
Zbyszek
More information about the systemd-devel
mailing list