]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
configure: introduce --enable-tests/--disable-tests
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 23 May 2022 19:51:51 +0000 (13:51 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 23 May 2022 19:51:57 +0000 (13:51 -0600)
commitff73f63faf01c0fe224a95281502feaf5933fe71
tree53ae64f4fd043c53a4b2b082911cefa2afad1c81
parente3c900fc3077224be58e0e287732c1d2b1d5591d
configure: introduce --enable-tests/--disable-tests

There are scenarios where running tests as part of the make check is
not desirable, like rpmbuild.  The build systems might not have the
environment to run the tests and might fail to build the packages.

This patch introduces, --enable-tests as a configure option, which
is set by default and can be disabled using the --disable-tests flag.
When disabled, the configure will skip creating the Makefiles for the
tests/* directories and in the top-level Makefile the SUBDIRS omits
tests. For example, consider the rpmbuild case to build rpm with
--disable-tests passed:
1. ./bootstrap.sh
2. ./configure ./configure --enable-opaque-hierarchy="name=systemd"
   --disable-tests
3. make check
4. make dist
5. cp libcgroup-2.0.2.tar.gz ~/rpmbuild/SOURCES
6. append --disable-tests to configure in libcgroup.spec
7. rpmbuild -ba libcgroup.spec

this will skip running the test/*, during the build, avoiding unexpected
failures

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Makefile.am
configure.ac