Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit] test: fix directory detection in lua-Harness suite
@ 2021-04-16 18:21 Sergey Kaplun via Tarantool-patches
  2021-04-19 13:42 ` Igor Munkin via Tarantool-patches
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2021-04-16 18:21 UTC (permalink / raw)
  To: Igor Munkin, Sergey Ostanevich; +Cc: tarantool-patches

<314-regex.t> uses `arg[0]:find'314'` to determine the name of the
directory where rx_* files are located. This leads to the test
failure, when lua-Harness suite run in the directory containing
"314" in its name, because the found path doesn't contain the required
files.

This patch fixes directory name detection.

Follows up tarantool/tarantool#5844
---

I tested it locally on branch in directory containing "314" in the name.
Also, I grepped the test suites with "find", "match", "sub" patterns,
but didn't see other places with such bug like that.

Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-harness-314-find-bug
Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-harness-314-find-bug

 test/lua-Harness-tests/314-regex.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/lua-Harness-tests/314-regex.t b/test/lua-Harness-tests/314-regex.t
index ad4554cd..58cdb66e 100755
--- a/test/lua-Harness-tests/314-regex.t
+++ b/test/lua-Harness-tests/314-regex.t
@@ -164,7 +164,7 @@ local function split (line)
 end
 
 local test_number = 0
-local dirname = arg[0]:sub(1, arg[0]:find'314' -1)
+local dirname = arg[0]:gsub('([^/]+)%.t$', '')
 for _, filename in ipairs(test_files) do
     local f, msg = io.open(dirname .. filename, 'r')
     if f == nil then
-- 
2.31.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-19 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 18:21 [Tarantool-patches] [PATCH luajit] test: fix directory detection in lua-Harness suite Sergey Kaplun via Tarantool-patches
2021-04-19 13:42 ` Igor Munkin via Tarantool-patches
2021-04-19 14:09 ` Sergey Ostanevich via Tarantool-patches
2021-04-19 19:39 ` Igor Munkin via Tarantool-patches

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