From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C910715810F for ; Sat, 10 Jun 2023 06:04:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0F0CBE0900; Sat, 10 Jun 2023 06:04:43 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E58D0E0900 for ; Sat, 10 Jun 2023 06:04:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CA957341107 for ; Sat, 10 Jun 2023 06:04:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0A4708DC for ; Sat, 10 Jun 2023 06:04:40 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1686375635.02d2824b4daeedd4084da53ebf3633a8b5508a92.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: meson.build test-functions X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 02d2824b4daeedd4084da53ebf3633a8b5508a92 X-VCS-Branch: master Date: Sat, 10 Jun 2023 06:04:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ad8362a9-e37d-42e9-a24b-ea762820731c X-Archives-Hash: 143e89cabcf7ed85bc3670598a0b92ee commit: 02d2824b4daeedd4084da53ebf3633a8b5508a92 Author: Kerin Millar plushkava net> AuthorDate: Sat Jun 10 05:40:35 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 10 05:40:35 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=02d2824b test-functions: Really fix non-conforming TAP output The previous "fix" was an experimental patch that was not yet intended for inclusion. This supplemental commit does as little as is necessary to render the test suite properly functional under meson, given that meson.build has been configured to expect the use of the TAP protocol. It also configures meson to be verbose while executing the test suite. As far as I can gather, the TAP support in meson is weak. Subtests do not appear to be supported. For that reason, I have dropped the TAP version from 14 to 13. While meson recognises "# SKIP" as a directive, it does not report the reason that may follow the text. Another issue is that no controlling terminal is present under meson. Therefore, test_update_cursor_coords() is rendered useless, for it will always be skipped. I have left the test in for the time being, in the hope that there may yet be a solution. In any case, this should be enough to render the -9999 ebuild both testable and usable. Signed-off-by: Kerin Millar plushkava.net> meson.build | 3 ++- test-functions | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index aa56907..2557168 100644 --- a/meson.build +++ b/meson.build @@ -46,6 +46,7 @@ if do_tests test( 'test-functions', files('test-functions'), workdir : meson.current_build_dir(), - protocol : 'tap' + protocol : 'tap', + verbose : true ) endif diff --git a/test-functions b/test-functions index 5e04c5f..aed6620 100755 --- a/test-functions +++ b/test-functions @@ -305,9 +305,8 @@ test_is_visible() { } test_update_cursor_coords() { - printf '%d..%d\n' "${tap_i}" "${tap_i}" skip() { - print 'ok %d # SKIP\n' "${tap_i}" + printf 'ok %d - _update_cursor_coords # SKIP\n' "$((testnum += 1))" } if _has_dumb_terminal; then skip @@ -323,10 +322,10 @@ test_update_cursor_coords() { # The terminal isn't smart skip elif ! _update_cursor_coords <>/dev/tty; then - printf 'not ok %d - _update_cursor_coords\n' "${tap_i}" + printf 'not ok %d - _update_cursor_coords\n' "$((testnum += 1))" false else - printf 'ok %d - _update_cursor_coords (x = %d, y = %d)\n' "${tap_i}" "${genfun_x}" "${genfun_y}" + printf 'ok %d - _update_cursor_coords (x = %d, y = %d)\n' "$((testnum += 1))" "${genfun_x}" "${genfun_y}" fi } @@ -374,7 +373,6 @@ iterate_tests() { shift total=$(( $# / slice_width )) - printf '%d..%d\n' "${tap_i}" "$((tap_i + total - 1))" passed=0 i=0 while [ "$((i += 1))" -le "${total}" ]; do @@ -405,9 +403,8 @@ iterate_tests() { else expected=">=$1" fi - printf 'ok %d - %s (expecting %s)\n' "${tap_i}" "${test_description}" "${expected}" + printf 'ok %d - %s (expecting %s)\n' "$((testnum += 1))" "${test_description}" "${expected}" shift "${slice_width}" - tap_i=$((tap_i + 1)) done return "$(( passed < total ))" } @@ -429,7 +426,7 @@ print_args() { printf '%s\n' "$*" } -printf 'TAP version 14\n' +printf 'TAP version 13\n' unset -v dir @@ -449,9 +446,9 @@ assign_tmpdir export TEST_GENFUNCS=1 export TZ=UTC -tap_i=1 - +testnum=0 rc=0 + test_chdir || rc=1 test_chdir_noop || rc=1 test_is_older_than || rc=1 @@ -462,5 +459,9 @@ test_is_int || rc=1 test_is_visible || rc=1 test_update_cursor_coords || rc=1 test_yesno || rc=1 + cleanup_tmpdir + +printf '1..%d\n' "${testnum}" + exit "${rc}"