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:
30
Makefile.am
30
Makefile.am
@@ -290,21 +290,23 @@ tests_unittests_unittests_CPPFLAGS = -Itests/
|
||||
tests_unittests_unittests_SOURCES = $(unittest_sources)
|
||||
tests_unittests_unittests_LDADD = -lcmocka
|
||||
|
||||
# Functional test were commented out because of:
|
||||
# https://github.com/profanity-im/profanity/pull/1010
|
||||
# An issue was raised for stabber:
|
||||
# https://github.com/profanity-im/stabber/issues/5
|
||||
# Once this issue is resolved functional tests should be enabled again
|
||||
# Functional tests require libstabber.
|
||||
# They are only built when libstabber is available.
|
||||
# See: https://github.com/profanity-im/profanity/pull/1010
|
||||
# https://github.com/profanity-im/stabber/issues/5
|
||||
#
|
||||
#if HAVE_STABBER
|
||||
#if HAVE_EXPECT
|
||||
#TESTS += tests/functionaltests/functionaltests
|
||||
#check_PROGRAMS += tests/functionaltests/functionaltests
|
||||
#tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
|
||||
#tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
|
||||
#tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect
|
||||
#endif
|
||||
#endif
|
||||
# Note: We use forkpty() instead of libexpect for PTY handling.
|
||||
|
||||
if HAVE_STABBER
|
||||
if HAVE_FORKPTY
|
||||
TESTS += tests/functionaltests/functionaltests
|
||||
check_PROGRAMS += tests/functionaltests/functionaltests
|
||||
tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
|
||||
tests_functionaltests_functionaltests_CPPFLAGS = -Itests/
|
||||
tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS)
|
||||
tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber @FORKPTY_LIB@
|
||||
endif
|
||||
endif
|
||||
|
||||
man1_MANS = $(man1_sources)
|
||||
|
||||
|
||||
10
configure.ac
10
configure.ac
@@ -374,9 +374,13 @@ PKG_CHECK_MODULES([cmocka], [cmocka], [],
|
||||
AM_CONDITIONAL([HAVE_STABBER], [false])
|
||||
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])])
|
||||
AM_CONDITIONAL([HAVE_EXPECT], [false])
|
||||
AC_CHECK_LIB([expect], [exp_expectl], [AM_CONDITIONAL([HAVE_EXPECT], [true])],
|
||||
[AC_MSG_NOTICE([libexpect not found, will not be able to run functional tests])])
|
||||
dnl Check for forkpty (needed for functional tests PTY handling)
|
||||
dnl On Linux it's in libutil, on some BSDs it's in libc
|
||||
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
|
||||
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-deprecated-declarations -std=gnu99 -ggdb3"
|
||||
|
||||
Reference in New Issue
Block a user