Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 4/5] test: introduce test:skiprest TAP helper
Date: Mon, 27 Feb 2023 09:07:22 +0000	[thread overview]
Message-ID: <73121e49f78fb8fee355ce09a80f77ef12046e67.1677236706.git.imun@tarantool.org> (raw)
In-Reply-To: <cover.1677236706.git.imun@tarantool.org>

Sometimes one need to skip the remaining tests in the script. There is
no special stub in TAP13 protocol for this, but this could be done via
skipping all the remaining planned tests.

Within this commit <test:skiprest> helper is introduced that calls
<test:skip> (planned - total) times and exits the test script. As for
the previous commit it's worth to mention, that skiprest helper is
implemented only for root (i.e. test with no parent) tests and subtests
are not supported at the moment. The corresponding assertion with FIXME
reason can be found in <finalize> routine.

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 test/tarantool-tests/tap.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/tarantool-tests/tap.lua b/test/tarantool-tests/tap.lua
index 92d59ce9..343f97e3 100644
--- a/test/tarantool-tests/tap.lua
+++ b/test/tarantool-tests/tap.lua
@@ -101,6 +101,13 @@ local function skipall(test, reason)
   finalize(test)
 end
 
+local function skiprest(test, reason)
+  for _ = 1, test.planned - test.total do
+    test:skip(reason)
+  end
+  finalize(test)
+end
+
 local function like(test, got, pattern, message, extra)
   extra = extra or {}
   extra.got = got
@@ -330,6 +337,7 @@ test_mt = {
     fail       = fail,
     skip       = skip,
     skipall    = skipall,
+    skiprest   = skiprest,
     is         = is,
     isnt       = isnt,
     isnil      = isnil,
-- 
2.30.2


  parent reply	other threads:[~2023-02-27  9:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27  9:07 [Tarantool-patches] [PATCH luajit 0/5] Tarantool tests enhancements Igor Munkin via Tarantool-patches
2023-02-27  9:07 ` [Tarantool-patches] [PATCH luajit 1/5] ci: use LuaJIT-test target in testing workflows Igor Munkin via Tarantool-patches
2023-02-27  9:41   ` Sergey Kaplun via Tarantool-patches
2023-02-28  7:42   ` Maxim Kokryashkin via Tarantool-patches
2023-02-27  9:07 ` [Tarantool-patches] [PATCH luajit 2/5] test: stop using utils.selfrun in tests Igor Munkin via Tarantool-patches
2023-02-27 10:08   ` Sergey Kaplun via Tarantool-patches
2023-02-27 18:04     ` Igor Munkin via Tarantool-patches
2023-02-28  7:46       ` Maxim Kokryashkin via Tarantool-patches
2023-02-27  9:07 ` [Tarantool-patches] [PATCH luajit 3/5] test: introduce test:skipall TAP helper Igor Munkin via Tarantool-patches
2023-02-27  9:51   ` Sergey Kaplun via Tarantool-patches
2023-02-27 18:04     ` Igor Munkin via Tarantool-patches
2023-02-28  7:51   ` Maxim Kokryashkin via Tarantool-patches
2023-02-28 16:26     ` Igor Munkin via Tarantool-patches
2023-02-27  9:07 ` Igor Munkin via Tarantool-patches [this message]
2023-02-27  9:56   ` [Tarantool-patches] [PATCH luajit 4/5] test: introduce test:skiprest " Sergey Kaplun via Tarantool-patches
2023-02-27 18:04     ` Igor Munkin via Tarantool-patches
2023-02-28  7:55   ` Maxim Kokryashkin via Tarantool-patches
2023-02-28 16:26     ` Igor Munkin via Tarantool-patches
2023-02-27  9:07 ` [Tarantool-patches] [PATCH luajit 5/5] test: make skipcond helper more convenient Igor Munkin via Tarantool-patches
2023-02-27 10:01   ` Sergey Kaplun via Tarantool-patches
2023-02-28  8:10   ` Maxim Kokryashkin via Tarantool-patches
2023-03-02 17:07 ` [Tarantool-patches] [PATCH luajit 0/5] Tarantool tests enhancements Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73121e49f78fb8fee355ce09a80f77ef12046e67.1677236706.git.imun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 4/5] test: introduce test:skiprest TAP helper' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox