From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org Subject: [Tarantool-patches] [PATCH v2 04/10] test: refactor with _retrieve_progname Date: Tue, 20 Jul 2021 19:26:52 +0300 [thread overview] Message-ID: <f5291258f9a0bf00e1f9473acf744ceda6fcc2c8.1626797225.git.m.kokryashkin@tarantool.org> (raw) In-Reply-To: <cover.1626797225.git.m.kokryashkin@tarantool.org> The patch[1] from lua-Harness suite fixes the same issue commit 837688590919fcf8de47ef90479fd2a640c8fddc ('test: adjust lua-Harness suite to CMake machinery') does except the single difference: `get_lua_binary_name()` is called `_retrieved_progname()`. As a result of this patch the function is renamed to follow the original naming. [1]: https://framagit.org/fperrad/lua-Harness/-/commit/1be25a8 Part of tarantool/tarantool#5970 Part of tarantool/tarantool#4473 --- .../241-standalone.t.disabled | 2 +- test/lua-Harness-tests/242-luac.t | 2 +- test/lua-Harness-tests/301-basic.t | 2 +- test/lua-Harness-tests/308-io.t | 2 +- test/lua-Harness-tests/309-os.t | 2 +- test/lua-Harness-tests/320-stdin.t | 2 +- test/lua-Harness-tests/411-luajit.t.disabled | 2 +- test/lua-Harness-tests/test_assertion.lua | 18 ++++++++---------- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/test/lua-Harness-tests/241-standalone.t.disabled b/test/lua-Harness-tests/241-standalone.t.disabled index a02ed5bf..47c50a6b 100755 --- a/test/lua-Harness-tests/241-standalone.t.disabled +++ b/test/lua-Harness-tests/241-standalone.t.disabled @@ -41,7 +41,7 @@ elseif ravi then banner = '^Ravi %d%.%d%.%d' end -local lua = get_lua_binary_name() +local lua = _retrieve_progname() local luac = jit and lua or (lua .. 'c') if not pcall(io.popen, lua .. [[ -e "a=1"]]) then diff --git a/test/lua-Harness-tests/242-luac.t b/test/lua-Harness-tests/242-luac.t index 0a2e160e..526b31fe 100755 --- a/test/lua-Harness-tests/242-luac.t +++ b/test/lua-Harness-tests/242-luac.t @@ -38,7 +38,7 @@ if ravi then skip_all("ravi") end -local lua = get_lua_binary_name() +local lua = _retrieve_progname() local luac = lua .. 'c' if not pcall(io.popen, lua .. [[ -e "a=1"]]) then diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t index 63f0004a..c45b2558 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -48,7 +48,7 @@ local has_warn = _VERSION >= 'Lua 5.4' local has_xpcall52 = _VERSION >= 'Lua 5.2' or jit local has_xpcall53 = _VERSION >= 'Lua 5.3' or jit -local lua = get_lua_binary_name() +local lua = _retrieve_progname() plan'no_plan' diff --git a/test/lua-Harness-tests/308-io.t b/test/lua-Harness-tests/308-io.t index 5ea3afc7..af2b3232 100755 --- a/test/lua-Harness-tests/308-io.t +++ b/test/lua-Harness-tests/308-io.t @@ -40,7 +40,7 @@ local has_read53 = _VERSION >= 'Lua 5.3' or luajit21 local has_meta53 = _VERSION >= 'Lua 5.3' local has_meta54 = _VERSION >= 'Lua 5.4' -local lua = get_lua_binary_name() +local lua = _retrieve_progname() plan'no_plan' diff --git a/test/lua-Harness-tests/309-os.t b/test/lua-Harness-tests/309-os.t index 14cbb89a..fbc2d24b 100755 --- a/test/lua-Harness-tests/309-os.t +++ b/test/lua-Harness-tests/309-os.t @@ -34,7 +34,7 @@ require'test_assertion' local profile = require'profile' local luajit20 = jit and (jit.version_num < 20100 and not jit.version:match'^RaptorJIT') local has_execute51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit) -local lua = get_lua_binary_name() +local lua = _retrieve_progname() plan'no_plan' diff --git a/test/lua-Harness-tests/320-stdin.t b/test/lua-Harness-tests/320-stdin.t index b65b8f37..bff63760 100755 --- a/test/lua-Harness-tests/320-stdin.t +++ b/test/lua-Harness-tests/320-stdin.t @@ -26,7 +26,7 @@ Tests Lua Basic & IO Libraries with stdin require'test_assertion' -local lua = get_lua_binary_name() +local lua = _retrieve_progname() if not pcall(io.popen, lua .. [[ -e "a=1"]]) then skip_all "io.popen not supported" diff --git a/test/lua-Harness-tests/411-luajit.t.disabled b/test/lua-Harness-tests/411-luajit.t.disabled index 39cca5b0..7830df4f 100755 --- a/test/lua-Harness-tests/411-luajit.t.disabled +++ b/test/lua-Harness-tests/411-luajit.t.disabled @@ -31,7 +31,7 @@ if not jit or ujit then skip_all("only with LuaJIT") end -local lua = get_lua_binary_name() +local lua = _retrieve_progname() if not pcall(io.popen, lua .. [[ -e "a=1"]]) then skip_all("io.popen not supported") diff --git a/test/lua-Harness-tests/test_assertion.lua b/test/lua-Harness-tests/test_assertion.lua index f50cc319..f126eab1 100644 --- a/test/lua-Harness-tests/test_assertion.lua +++ b/test/lua-Harness-tests/test_assertion.lua @@ -9,6 +9,14 @@ ]] +function _retrieve_progname () + local i = 0 + while arg[i] do + i = i - 1 + end + return arg[i + 1] +end + if pcall(require, 'Test.Assertion') then diag 'Test.Assertion loaded' return @@ -219,16 +227,6 @@ function todo (reason, count) todo_reason = reason end --- The least arg element is guaranteed to be the name --- of the tested binary. -function get_lua_binary_name () - local i = 0 - while arg[i] do - i = i - 1 - end - return arg[i + 1] -end - -- XXX: If tests is run out of the tests source tree, the -- relative paths below become invalid. Hence, we need to -- prepend the directory from the script (i.e. test) name to -- 2.32.0
next prev parent reply other threads:[~2021-07-20 16:29 UTC|newest] Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-20 16:26 [Tarantool-patches] [PATCH v2 00/10] test: lua-Harness suite patch bump Maxim Kokryashkin via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 01/10] test: port lua-Harness to Test.Assertion Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:08 ` Igor Munkin via Tarantool-patches 2021-07-26 10:38 ` Максим Корякшин via Tarantool-patches 2021-07-27 6:41 ` Sergey Kaplun via Tarantool-patches 2021-07-27 22:18 ` Максим Корякшин via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 02/10] test: rename lua-Harness tap to test_assertion Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:08 ` Igor Munkin via Tarantool-patches 2021-07-27 6:27 ` Sergey Kaplun via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 03/10] test: use CI friendly variables in lua-Harness Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:09 ` Igor Munkin via Tarantool-patches 2021-07-27 9:01 ` Sergey Kaplun via Tarantool-patches 2021-07-27 22:23 ` Максим Корякшин via Tarantool-patches 2021-07-20 16:26 ` Maxim Kokryashkin via Tarantool-patches [this message] 2021-07-25 21:09 ` [Tarantool-patches] [PATCH v2 04/10] test: refactor with _retrieve_progname Igor Munkin via Tarantool-patches 2021-07-27 9:27 ` Sergey Kaplun via Tarantool-patches 2021-07-27 22:28 ` Максим Корякшин via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 05/10] test: refactor with _dofile Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:10 ` Igor Munkin via Tarantool-patches 2021-07-26 12:11 ` Максим Корякшин via Tarantool-patches 2021-07-27 9:34 ` Sergey Kaplun via Tarantool-patches 2021-07-27 22:36 ` Максим Корякшин via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 06/10] test: support tarantool in lua-Harness Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:11 ` Igor Munkin via Tarantool-patches 2021-07-26 11:07 ` Максим Корякшин via Tarantool-patches 2021-07-26 19:46 ` Igor Munkin via Tarantool-patches 2021-07-27 10:04 ` Sergey Kaplun via Tarantool-patches 2021-07-28 17:40 ` Максим Корякшин via Tarantool-patches 2021-07-28 17:42 ` Максим Корякшин via Tarantool-patches 2021-07-28 18:34 ` Sergey Kaplun via Tarantool-patches 2021-07-29 9:19 ` Максим Корякшин via Tarantool-patches 2021-07-29 9:22 ` Igor Munkin via Tarantool-patches 2021-07-29 10:12 ` Максим Корякшин via Tarantool-patches 2021-07-29 9:47 ` Sergey Kaplun via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 07/10] test: backport lua-Harness directory detection Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:12 ` Igor Munkin via Tarantool-patches 2021-07-26 11:13 ` Максим Корякшин via Tarantool-patches 2021-07-28 18:37 ` Sergey Kaplun via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 08/10] test: support tarantool cli in lua-Harness Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:13 ` Igor Munkin via Tarantool-patches 2021-07-26 11:17 ` Максим Корякшин via Tarantool-patches 2021-07-26 19:53 ` Igor Munkin via Tarantool-patches 2021-07-28 18:44 ` Sergey Kaplun via Tarantool-patches 2021-07-28 18:50 ` Sergey Kaplun via Tarantool-patches 2021-07-29 9:23 ` Максим Корякшин via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 09/10] test: update lua-Harness to b7b1a9a2 Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:14 ` Igor Munkin via Tarantool-patches 2021-07-26 12:21 ` Максим Корякшин via Tarantool-patches 2021-07-26 20:04 ` Igor Munkin via Tarantool-patches 2021-07-28 18:48 ` Sergey Kaplun via Tarantool-patches 2021-07-29 9:27 ` Максим Корякшин via Tarantool-patches 2021-07-20 16:26 ` [Tarantool-patches] [PATCH v2 10/10] test: disable test/lua-Harness-tests/241-standalone.t on FreeBSD Maxim Kokryashkin via Tarantool-patches 2021-07-25 21:17 ` Igor Munkin via Tarantool-patches 2021-07-26 12:31 ` Максим Корякшин via Tarantool-patches 2021-07-26 12:32 ` Максим Корякшин via Tarantool-patches 2021-07-26 12:36 ` Максим Корякшин via Tarantool-patches 2021-07-26 20:13 ` Igor Munkin via Tarantool-patches 2021-07-27 6:21 ` Sergey Kaplun via Tarantool-patches 2021-07-29 9:41 ` Максим Корякшин via Tarantool-patches 2021-07-29 9:45 ` Sergey Kaplun via Tarantool-patches 2021-07-29 9:57 ` Максим Корякшин via Tarantool-patches 2021-07-30 17:09 ` Igor Munkin via Tarantool-patches 2021-07-25 21:03 ` [Tarantool-patches] [PATCH v2 00/10] test: lua-Harness suite patch bump Igor Munkin via Tarantool-patches 2021-07-30 19:19 ` 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=f5291258f9a0bf00e1f9473acf744ceda6fcc2c8.1626797225.git.m.kokryashkin@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=max.kokryashkin@gmail.com \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v2 04/10] test: refactor with _retrieve_progname' \ /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