From nobody Fri Oct 22 14:44:55 2021 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E64FA181E8AB; Fri, 22 Oct 2021 14:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbRvq551zz3KrX; Fri, 22 Oct 2021 14:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30EEF10AB4; Fri, 22 Oct 2021 14:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19MEitc3012483; Fri, 22 Oct 2021 14:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MEitLo012482; Fri, 22 Oct 2021 14:44:55 GMT (envelope-from git) Date: Fri, 22 Oct 2021 14:44:55 GMT Message-Id: <202110221444.19MEitLo012482@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: eb8ddc4ec15c - main - net-im/signal-cli: Add an interactive test target List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb8ddc4ec15c032a275ee4d4dad861db1388b69a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N 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