Date: Fri, 22 Oct 2021 14:44:55 GMT From: Mateusz Piotrowski <0mp@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: eb8ddc4ec15c - main - net-im/signal-cli: Add an interactive test target Message-ID: <202110221444.19MEitLo012482@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/ports/commit/?id=eb8ddc4ec15c032a275ee4d4dad861db1388b69a commit eb8ddc4ec15c032a275ee4d4dad861db1388b69a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-22 14:02:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-22 14:44:44 +0000 net-im/signal-cli: Add an interactive test target This is the best kind of semi-automated testing we can have now for this port. --- net-im/signal-cli/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net-im/signal-cli/Makefile b/net-im/signal-cli/Makefile index c1c9b2ac63f2..772180cd8f91 100644 --- a/net-im/signal-cli/Makefile +++ b/net-im/signal-cli/Makefile @@ -17,6 +17,7 @@ BUILD_DEPENDS= asciidoc>0:textproc/asciidoc LIB_DEPENDS= libsignal_jni.so:net-im/libsignal-client \ libzkgroup.so:net-im/zkgroup RUN_DEPENDS= libsignal-client>=0.9.0:net-im/libsignal-client +TEST_DEPENDS= qrencode:graphics/libqrencode USES= gmake shebangfix USE_GITHUB= yes @@ -36,6 +37,8 @@ SUB_LIST= JAVA_HOME="${JAVA_HOME}" BUILD_WRKSRC= ${WRKSRC}/man +TEST_ENV= ${MAKE_ENV} XDG_DATA_HOME=${WORKDIR}/xdg-data-home + USERS= signal-cli GROUPS= signal-cli @@ -74,4 +77,18 @@ post-install-DBUS-on: ${INSTALL_DATA} ${WRKSRC}/data/org.asamk.Signal.conf \ ${STAGEDIR}${PREFIX}/etc/dbus-1/system.d +pre-test: + if [ "${_TEST_SIGNAL_CLI_USERNAME}" = "" ]; then \ + @${ECHO_MSG} "_TEST_SIGNAL_CLI_USERNAME must be set to run tests"; \ + ${FALSE}; \ + fi + +do-test: + ${SETENV} ${TEST_ENV} ${STAGEDIR}${DATADIR}/bin/signal-cli \ + link --name "${PORTNAME} test $$(date)" | \ + xargs -n 1 qrencode -t ANSI256 + ${SETENV} ${TEST_ENV} ${STAGEDIR}${DATADIR}/bin/signal-cli \ + send --message "${PORTNAME} test $$(date)" \ + "${_TEST_SIGNAL_CLI_USERNAME}" + .include <bsd.port.mk>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110221444.19MEitLo012482>