Skip to content

Commit

Permalink
qmltest: configure to only compile with qml and tests enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny Carlson authored and Johnny Carlson committed Jan 13, 2023
1 parent 7603dc8 commit 082b543
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
7 changes: 5 additions & 2 deletions build-aux/m4/bitcoin_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
if test "$have_qt_test" = "no"; then
bitcoin_enable_qt_test=no
fi
bitcoin_enable_qml_test=yes
if test "$have_qml_test" = "no"; then
bitcoin_enable_qml_test=no
fi
bitcoin_enable_qt_dbus=no
if test "$use_dbus" != "no" && test "$have_qt_dbus" = "yes"; then
bitcoin_enable_qt_dbus=yes
Expand Down Expand Up @@ -468,8 +472,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
[BITCOIN_QT_FAIL([${qt_lib_prefix}QuickControls2${qt_lib_suffix} $qt_version not found])])
])
BITCOIN_QT_CHECK([
PKG_CHECK_MODULES([QT_QUICKTEST], [${qt_lib_prefix}QuickTest${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_QUICKTEST_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_QUICKTEST_LIBS $QT_LIBS"],
[BITCOIN_QT_FAIL([${qt_lib_prefix}QuickTest${qt_lib_suffix} $qt_version not found])])
PKG_CHECK_MODULES([QT_QUICKTEST], [${qt_lib_prefix}QuickTest${qt_lib_suffix} $qt_version], [QT_QMLTEST_INCLUDES="$QT_QUICKTEST_CFLAGS"; have_quick_test=yes],[have_quick_test=no])
])
AC_DEFINE([USE_QML], [1], [Define to 1 to use QML-based GUI])
Expand Down
12 changes: 11 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1812,8 +1812,9 @@ fi

dnl these are only used when qt is enabled
BUILD_TEST_QT=""
BUILD_TEST_QML=""
if test "$use_qml" != "no"; then
use_gui_tests=no
bitcoin_enable_qt_test=no
fi
if test "$bitcoin_enable_qt" != "no"; then
dnl enable dbus support
Expand Down Expand Up @@ -1849,6 +1850,14 @@ if test "$bitcoin_enable_qt" != "no"; then
else
AC_MSG_RESULT([no])
fi

AC_MSG_CHECKING([whether to build qml/test_bitcoin-qt])
if test "$use_gui_tests$bitcoin_enable_qml_test" = "yesyes"; then
AC_MSG_RESULT([yes])
BUILD_TEST_QML="yes"
else
AC_MSG_RESULT([no])
fi
fi

AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"])
Expand Down Expand Up @@ -1889,6 +1898,7 @@ AM_CONDITIONAL([ENABLE_FUZZ], [test "$enable_fuzz" = "yes"])
AM_CONDITIONAL([ENABLE_FUZZ_BINARY], [test "$enable_fuzz_binary" = "yes"])
AM_CONDITIONAL([ENABLE_QT], [test "$bitcoin_enable_qt" = "yes"])
AM_CONDITIONAL([ENABLE_QT_TESTS], [test "$BUILD_TEST_QT" = "yes"])
AM_CONDITIONAL([ENABLE_QML_TESTS], [test "$BUILD_TEST_QML" = "yes"])
AM_CONDITIONAL([ENABLE_BENCH], [test "$use_bench" = "yes"])
AM_CONDITIONAL([USE_QRCODE], [test "$use_qr" = "yes"])
AM_CONDITIONAL([USE_LCOV], [test "$use_lcov" = "yes"])
Expand Down
5 changes: 4 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1104,11 +1104,14 @@ endif

if ENABLE_QT
include Makefile.qt.include
include Makefile.qmltest.include
endif

if ENABLE_QT_TESTS
include Makefile.qttest.include
endif

if ENABLE_QML_TESTS
include Makefile.qmltest.include
endif

include Makefile.univalue.include
4 changes: 2 additions & 2 deletions src/Makefile.qmltest.include
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TEST_QML_MOC_CPP = qml/test/moc_onboardingtests.cpp
TEST_QML_H = qml/test/onboardingtests.h qml/test/imageprovider.h

qml_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_TEST_INCLUDES) $(QT_QUICKTEST_INCLUDES) $(BOOST_CPPFLAGS)
$(QT_INCLUDES) $(QT_TEST_INCLUDES) $(QT_QUICKTEST_INCLUDES) $(BOOST_CPPFLAGS) $(QT_QUICKTEST_CFLAGS)

qml_test_test_bitcoin_qt_SOURCES = \
qml/test/onboardingtests.cpp \
Expand All @@ -24,7 +24,7 @@ qml_test_test_bitcoin_qt_LDADD = $(QT_QUICKTEST_LIBS) $(QT_TEST_LIBS) $(QT_LIBS)
qml_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
qml_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)

CLEAN_BITCOIN_QML_TEST = $(TEST_QML_MOC_CPP) qml/test/*.gcda qml/test/*.gcno
CLEAN_BITCOIN_QML_TEST = $(TEST_QML_MOC_CPP)

CLEANFILES += $(CLEAN_BITCOIN_QML_TEST)

Expand Down

0 comments on commit 082b543

Please sign in to comment.