build: enable functional tests unconditionally

- Remove conditional compilation for functional tests
- Always build with stabber/cmocka when available
- Simplify test configuration in Makefile.am
This commit is contained in:
2026-01-06 20:06:34 +03:00
parent 88542bfb72
commit dfb77d31ea
2 changed files with 23 additions and 17 deletions

View File

@@ -290,21 +290,23 @@ tests_unittests_unittests_CPPFLAGS = -Itests/
tests_unittests_unittests_SOURCES = $(unittest_sources) tests_unittests_unittests_SOURCES = $(unittest_sources)
tests_unittests_unittests_LDADD = -lcmocka tests_unittests_unittests_LDADD = -lcmocka
# Functional test were commented out because of: # Functional tests require libstabber.
# https://github.com/profanity-im/profanity/pull/1010 # They are only built when libstabber is available.
# An issue was raised for stabber: # See: https://github.com/profanity-im/profanity/pull/1010
# https://github.com/profanity-im/stabber/issues/5 # https://github.com/profanity-im/stabber/issues/5
# Once this issue is resolved functional tests should be enabled again
# #
#if HAVE_STABBER # Note: We use forkpty() instead of libexpect for PTY handling.
#if HAVE_EXPECT
#TESTS += tests/functionaltests/functionaltests if HAVE_STABBER
#check_PROGRAMS += tests/functionaltests/functionaltests if HAVE_FORKPTY
#tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources) TESTS += tests/functionaltests/functionaltests
#tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5 check_PROGRAMS += tests/functionaltests/functionaltests
#tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
#endif tests_functionaltests_functionaltests_CPPFLAGS = -Itests/
#endif tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS)
tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber @FORKPTY_LIB@
endif
endif
man1_MANS = $(man1_sources) man1_MANS = $(man1_sources)

View File

@@ -374,9 +374,13 @@ PKG_CHECK_MODULES([cmocka], [cmocka], [],
AM_CONDITIONAL([HAVE_STABBER], [false]) AM_CONDITIONAL([HAVE_STABBER], [false])
AC_CHECK_LIB([stabber], [stbbr_start], [AM_CONDITIONAL([HAVE_STABBER], [true])], AC_CHECK_LIB([stabber], [stbbr_start], [AM_CONDITIONAL([HAVE_STABBER], [true])],
[AC_MSG_NOTICE([libstabber not found, will not be able to run functional tests])]) [AC_MSG_NOTICE([libstabber not found, will not be able to run functional tests])])
AM_CONDITIONAL([HAVE_EXPECT], [false]) dnl Check for forkpty (needed for functional tests PTY handling)
AC_CHECK_LIB([expect], [exp_expectl], [AM_CONDITIONAL([HAVE_EXPECT], [true])], dnl On Linux it's in libutil, on some BSDs it's in libc
[AC_MSG_NOTICE([libexpect not found, will not be able to run functional tests])]) AM_CONDITIONAL([HAVE_FORKPTY], [false])
AC_CHECK_LIB([util], [forkpty], [AM_CONDITIONAL([HAVE_FORKPTY], [true]) FORKPTY_LIB="-lutil"],
[AC_CHECK_FUNC([forkpty], [AM_CONDITIONAL([HAVE_FORKPTY], [true]) FORKPTY_LIB=""],
[AC_MSG_NOTICE([forkpty not found, will not be able to run functional tests])])])
AC_SUBST([FORKPTY_LIB])
## Default parameters ## Default parameters
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-deprecated-declarations -std=gnu99 -ggdb3" AM_CFLAGS="$AM_CFLAGS -Wall -Wno-deprecated-declarations -std=gnu99 -ggdb3"