summaryrefslogtreecommitdiffstats
path: root/m4/libo_fuzz_configury.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /m4/libo_fuzz_configury.m4
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/libo_fuzz_configury.m4')
-rw-r--r--m4/libo_fuzz_configury.m451
1 files changed, 51 insertions, 0 deletions
diff --git a/m4/libo_fuzz_configury.m4 b/m4/libo_fuzz_configury.m4
new file mode 100644
index 0000000000..013908e28d
--- /dev/null
+++ b/m4/libo_fuzz_configury.m4
@@ -0,0 +1,51 @@
+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 --with-$1=$m4_translit([with-$1], [-+.], [___])])
+ libo_fuzzed_[]m4_translit([with-$1], [-+.], [___])=yes
+ libo_fuzz_list="$libo_fuzz_list --with-$1="'$m4_translit([with-$1], [-+.], [___])'
+ 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 --enable-$1=$m4_translit([enable-$1], [-+.], [___])])
+ libo_fuzzed_[]m4_translit([enable-$1], [-+.], [___])=yes
+ libo_fuzz_list="$libo_fuzz_list --enable-$1="'$m4_translit([enable-$1], [-+.], [___])'
+ fi
+ [$4])
+])
+
+AC_DEFUN([libo_FUZZ_SUMMARY], [
+ if test -n "$libo_fuzz_list"; then
+ tmps=`eval echo $libo_fuzz_list`
+ AC_MSG_NOTICE([Summary of fuzzing: $tmps])
+ fi
+])
+
+dnl vim:set shiftwidth=4 softtabstop=4 expandtab: