Main: configure.ac: Add option to enable tests that require Python

This commit is contained in:
Alex Kotov 2022-05-23 22:58:33 +03:00
parent 65065a9f4a
commit ed357c0a81
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
7 changed files with 99 additions and 80 deletions

View File

@ -10,7 +10,7 @@ main_freebsd_task:
- pkg install --yes autoconf automake
main_build_script:
- ./autogen.sh
- ./configure --enable-tests CFLAGS='-O3'
- ./configure --enable-tests-all CFLAGS='-O3'
- make
- sudo make install
main_test_script:

View File

@ -22,7 +22,7 @@ jobs:
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --enable-tests CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}'
run: ./configure --enable-tests-all CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}'
- name: make
run: make
- name: check
@ -51,7 +51,7 @@ jobs:
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --enable-tests --without-all
run: ./configure --enable-tests-all --without-all
- name: make
run: make
- name: check

View File

@ -1,3 +1,7 @@
2022-05-23 Alex Kotov <kotovalexarian@gmail.com>
* configure.ac: Add option to enable tests that require Python
2022-02-10 Alex Kotov <kotovalexarian@gmail.com>
* configure.ac: Normalize args

View File

@ -137,7 +137,7 @@ environment.
```
./autogen.sh
./configure --enable-tests
./configure --enable-tests-all
make
```

View File

@ -7,4 +7,4 @@ if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
PREFIX="$REPO/dest/dev-native"
"$REPO/configure" --prefix="$PREFIX" --enable-tests
"$REPO/configure" --prefix="$PREFIX" --enable-tests-all

View File

@ -5,4 +5,4 @@ set -eux
REPO="$(realpath "$(dirname "$(realpath "$0")")/..")"
if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
"$REPO/configure" --enable-tests
"$REPO/configure" --enable-tests-all

View File

@ -25,6 +25,8 @@ AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -
dnl Features (disabled by default)
AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [enable tests and examples]))
AC_ARG_ENABLE([tests-all], AS_HELP_STRING([--enable-tests-all], [enable all tests]))
AC_ARG_ENABLE([tests-python], AS_HELP_STRING([--enable-tests-python], [enable tests that require Python]))
dnl Packages (enabled by default)
AC_ARG_WITH( [all], AS_HELP_STRING([--without-all], [without all default packages]))
@ -55,6 +57,13 @@ AC_ARG_WITH( [libc-strnlen], AS_HELP_STRING([--with-libc-strnlen], [with strn
# Default args #
################
AC_DEFUN([do_enable_tests_all],
[
if test -z "$enable_tests"; then enable_tests=yes; fi
if test -z "$enable_tests_python"; then enable_tests_python=yes; fi
])
AS_IF([test "$enable_tests_all" = yes], do_enable_tests_all)
AC_DEFUN([do_without_all],
[
if test -z "$with_cmdline"; then with_cmdline=no; fi
@ -96,6 +105,8 @@ AS_IF([test "$enable_werror" = no ], [enable_werror=no], [enable_werror
dnl Features (disabled by default)
AS_IF([test "$enable_tests" = yes], [enable_tests=yes], [enable_tests=no])
AS_IF([test "$enable_tests_all" = yes], [enable_tests_all=yes], [enable_tests_all=no])
AS_IF([test "$enable_tests_python" = yes], [enable_tests_python=yes], [enable_tests_python=no])
dnl Packages (enabled by default)
AS_IF([test "$with_all" = no ], [with_all=no], [with_all=yes])
@ -124,6 +135,8 @@ AS_IF([test "$with_libc_strnlen" = yes], [with_libc_strnlen=yes], [with_libc_str
AS_IF([test "$host_cpu" != "$build_cpu" -a "$enable_tests" = yes], AC_MSG_ERROR([can not build cross-platform tests]))
AS_IF([test "$enable_tests" = no -a "$enable_tests_python" = yes], AC_MSG_ERROR([Python tests require usual tests]))
AS_IF([test "$with_ntoa" = no -a "$with_printf" = yes], AC_MSG_ERROR([package `printf' requires package `ntoa']))
AS_IF([test "$with_ntoa" = no -a "$with_units" = yes], AC_MSG_ERROR([package `units' requires package `ntoa']))
@ -142,6 +155,7 @@ AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes])
dnl Features (disabled by default)
AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = yes])
AM_CONDITIONAL([ENABLE_TESTS_PYTHON], [test "$enable_tests_python" = yes])
dnl Packages (enabled by default)
AM_CONDITIONAL([WITH_CMDLINE], [test "$with_cmdline" = yes])
@ -179,6 +193,7 @@ AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR], [1], [e
dnl Features (disabled by default)
AS_IF([test "$enable_tests" = yes], [AC_DEFINE([ENABLE_TESTS], [1], [enabled tests and examples])])
AS_IF([test "$enable_tests_python" = yes], [AC_DEFINE([ENABLE_TESTS_PYTHON], [1], [enable tests that require Python])])
dnl Packages (enabled by default)
AS_IF([test "$with_cmdline" = yes], [AC_DEFINE([WITH_CMDLINE], [1], [with command line parser])])