Kaydet (Commit) 472c07ca authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Introduce configure option fuzzing

When --enable-fuzz-options is given, those --enable or --with options
that are separately so marked, and have not been specified explicitly
at the configure command line (i.e. typically from autogen.input), are
randomly set to either yes or no.

This functionality is useful to make sure configure options don't
bit-rot by randomly exercising uncommon settings and combinations.

To enable fuzzing for an option, use libo_FUZZ_ARG_WITH instead of
AC_ARG_WITH, or libo_FUZZ_ARG_ENABLE instead of AC_ARG_ENABLE.

Also handle two cases of incompatibilty of options discovered by using
--enable-fuzz-options. In general using incompatible options should
cause an AC_MSG_ERROR(), but when one of the options in question has
been set by fuzzing, it's simplest to just reset it to the compatible
value.

Obviously this is highly experimental.

Change-Id: I76d250c148892951a7fda25ba4164de8bc693a26
üst 1b6545d2
This diff is collapsed.
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
AC_DEFUN([libo_FUZZ_ARG_WITH], [
AC_ARG_WITH([$1],
[$2],
[$3],
if test "$enable_fuzz_options" = yes; then
if test `expr $RANDOM % 2` = 1; then
m4_translit([with-$1], [-+.], [___])=yes
else
m4_translit([with-$1], [-+.], [___])=no
fi
AC_MSG_NOTICE([Randomly set m4_translit([with-$1], [-+.], [___]) to $m4_translit([with-$1], [-+.], [___])])
libo_fuzzed_[]m4_translit([with-$1], [-+.], [___])=yes
fi
[$4]
)
])
AC_DEFUN([libo_FUZZ_ARG_ENABLE], [
AC_ARG_ENABLE([$1],
[$2],
[$3],
if test "$enable_fuzz_options" = yes; then
if test `expr $RANDOM % 2` = 1; then
m4_translit([enable-$1], [-+.], [___])=yes
else
m4_translit([enable-$1], [-+.], [___])=no
fi
AC_MSG_NOTICE([Randomly set m4_translit([enable-$1], [-+.], [___]) to $m4_translit([enable-$1], [-+.], [___])])
libo_fuzzed_[]m4_translit([enable-$1], [-+.], [___])=yes
fi
[$4])
])
dnl vim:set shiftwidth=4 softtabstop=4 expandtab:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment