Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Ostanevich via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 2/6] test: adjust lua-Harness test suite for Tarantool
Date: Sat, 13 Mar 2021 21:41:37 +0300	[thread overview]
Message-ID: <17DBB8DA-FF25-464A-A187-6E1D6AFB1954@tarantool.org> (raw)
In-Reply-To: <bced664d18c02b9249719227961f167f17c56544.1615470667.git.skaplun@tarantool.org>

Hi!

Thanks for the patch!

LGTM.

Sergos.

> On 12 Mar 2021, at 08:27, Sergey Kaplun <skaplun@tarantool.org> wrote:
> 
> This patch makes it possible to run lua-Harness test suite using
> Tarantool.
> 
> Tarantool has its own loaded tap built in so need to change name to
> another one.
> 
> 203-lexico.t and 301-basic.t is adjusted to valid working with
> out-of-source build in Tarantool CI.
> 
> Also creates additional list of files provided to prove via stdin.
> This is required to avoid tests hungs via Tarantool's binary.
> Partially this problem is descripted in tarantool/tarantool#5040.
> 
> Part of tarantool/tarantool#5844
> Part of tarantool/tarantool#4473
> ---
> Author: Mergen Imeev <imeevma@gmail.com>
> 
> .gitignore                                      |  1 +
> test/lua-Harness-tests/090-tap.t                |  2 +-
> test/lua-Harness-tests/091-profile.t            |  2 +-
> test/lua-Harness-tests/101-boolean.t            |  2 +-
> test/lua-Harness-tests/102-function.t           |  2 +-
> test/lua-Harness-tests/103-nil.t                |  2 +-
> test/lua-Harness-tests/104-number.t             |  2 +-
> test/lua-Harness-tests/105-string.t             |  2 +-
> test/lua-Harness-tests/106-table.t              |  2 +-
> test/lua-Harness-tests/107-thread.t             |  2 +-
> test/lua-Harness-tests/108-userdata.t           |  2 +-
> test/lua-Harness-tests/200-examples.t           |  2 +-
> test/lua-Harness-tests/201-assign.t             |  2 +-
> test/lua-Harness-tests/202-expr.t               |  2 +-
> test/lua-Harness-tests/203-lexico.t             | 14 +++++++++-----
> test/lua-Harness-tests/204-grammar.t            |  2 +-
> test/lua-Harness-tests/211-scope.t              |  2 +-
> test/lua-Harness-tests/212-function.t           |  2 +-
> test/lua-Harness-tests/213-closure.t            |  2 +-
> test/lua-Harness-tests/214-coroutine.t          |  2 +-
> test/lua-Harness-tests/221-table.t              |  2 +-
> test/lua-Harness-tests/222-constructor.t        |  2 +-
> test/lua-Harness-tests/223-iterator.t           |  2 +-
> test/lua-Harness-tests/231-metatable.t          |  2 +-
> test/lua-Harness-tests/232-object.t             |  2 +-
> test/lua-Harness-tests/241-standalone.t         | 10 +++++-----
> test/lua-Harness-tests/242-luac.t               |  2 +-
> test/lua-Harness-tests/301-basic.t              |  7 +++++--
> test/lua-Harness-tests/303-package.t            |  6 +++---
> test/lua-Harness-tests/304-string.t             |  2 +-
> test/lua-Harness-tests/305-utf8.t               |  2 +-
> test/lua-Harness-tests/306-table.t              |  2 +-
> test/lua-Harness-tests/307-math.t               |  2 +-
> test/lua-Harness-tests/308-io.t                 |  2 +-
> test/lua-Harness-tests/309-os.t                 |  2 +-
> test/lua-Harness-tests/310-debug.t              |  2 +-
> test/lua-Harness-tests/311-bit32.t              |  2 +-
> test/lua-Harness-tests/314-regex.t              |  2 +-
> test/lua-Harness-tests/320-stdin.t              |  2 +-
> test/lua-Harness-tests/401-bitop.t              |  2 +-
> test/lua-Harness-tests/402-ffi.t                |  2 +-
> test/lua-Harness-tests/403-jit.t                |  2 +-
> test/lua-Harness-tests/404-ext.t                |  2 +-
> test/lua-Harness-tests/411-luajit.t             |  2 +-
> test/lua-Harness-tests/CMakeLists.txt           | 17 +++++++++++++++--
> .../{tap.lua => tap_harness.lua}                |  0
> 46 files changed, 77 insertions(+), 56 deletions(-)
> rename test/lua-Harness-tests/{tap.lua => tap_harness.lua} (100%)
> 
> diff --git a/.gitignore b/.gitignore
> index 2103a30..1fb81bc 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -20,3 +20,4 @@ compile_commands.json
> install_manifest.txt
> luajit-parse-memprof
> luajit.pc
> +tests_list
> diff --git a/test/lua-Harness-tests/090-tap.t b/test/lua-Harness-tests/090-tap.t
> index 92f04d8..99932f2 100755
> --- a/test/lua-Harness-tests/090-tap.t
> +++ b/test/lua-Harness-tests/090-tap.t
> @@ -22,7 +22,7 @@
> 
> ]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(3)
> ok( true, 'ok' )
> diff --git a/test/lua-Harness-tests/091-profile.t b/test/lua-Harness-tests/091-profile.t
> index db47438..ebc142d 100755
> --- a/test/lua-Harness-tests/091-profile.t
> +++ b/test/lua-Harness-tests/091-profile.t
> @@ -22,7 +22,7 @@
> 
> ]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan'no_plan'
> 
> diff --git a/test/lua-Harness-tests/101-boolean.t b/test/lua-Harness-tests/101-boolean.t
> index 0033eff..653509f 100755
> --- a/test/lua-Harness-tests/101-boolean.t
> +++ b/test/lua-Harness-tests/101-boolean.t
> @@ -22,7 +22,7 @@
> 
> ]]
> 
> -require'tap'
> +require'tap_harness'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/102-function.t b/test/lua-Harness-tests/102-function.t
> index 48ed814..cb7e9d0 100755
> --- a/test/lua-Harness-tests/102-function.t
> +++ b/test/lua-Harness-tests/102-function.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/103-nil.t b/test/lua-Harness-tests/103-nil.t
> index 561b101..a74c491 100755
> --- a/test/lua-Harness-tests/103-nil.t
> +++ b/test/lua-Harness-tests/103-nil.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/104-number.t b/test/lua-Harness-tests/104-number.t
> index 0d4d3fd..634d22a 100755
> --- a/test/lua-Harness-tests/104-number.t
> +++ b/test/lua-Harness-tests/104-number.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> diff --git a/test/lua-Harness-tests/105-string.t b/test/lua-Harness-tests/105-string.t
> index cd8c88b..f2ea067 100755
> --- a/test/lua-Harness-tests/105-string.t
> +++ b/test/lua-Harness-tests/105-string.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> diff --git a/test/lua-Harness-tests/106-table.t b/test/lua-Harness-tests/106-table.t
> index 0c0ba49..4a66f69 100755
> --- a/test/lua-Harness-tests/106-table.t
> +++ b/test/lua-Harness-tests/106-table.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/107-thread.t b/test/lua-Harness-tests/107-thread.t
> index 3d4af18..e67ef36 100755
> --- a/test/lua-Harness-tests/107-thread.t
> +++ b/test/lua-Harness-tests/107-thread.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/108-userdata.t b/test/lua-Harness-tests/108-userdata.t
> index b1e3641..687b1b8 100755
> --- a/test/lua-Harness-tests/108-userdata.t
> +++ b/test/lua-Harness-tests/108-userdata.t
> @@ -22,7 +22,7 @@
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_op53 = _VERSION >= 'Lua 5.3'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/200-examples.t b/test/lua-Harness-tests/200-examples.t
> index 362aae3..cb06a80 100755
> --- a/test/lua-Harness-tests/200-examples.t
> +++ b/test/lua-Harness-tests/200-examples.t
> @@ -24,7 +24,7 @@ First tests in order to check infrastructure.
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(5)
> 
> diff --git a/test/lua-Harness-tests/201-assign.t b/test/lua-Harness-tests/201-assign.t
> index 7d023d8..f7ed472 100755
> --- a/test/lua-Harness-tests/201-assign.t
> +++ b/test/lua-Harness-tests/201-assign.t
> @@ -28,7 +28,7 @@ L<https://www.lua.org/manual/5.4/manual.html#3.3.3>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_env = _VERSION >= 'Lua 5.2'
> 
> plan'no_plan'
> diff --git a/test/lua-Harness-tests/202-expr.t b/test/lua-Harness-tests/202-expr.t
> index 2576750..f03d5ea 100755
> --- a/test/lua-Harness-tests/202-expr.t
> +++ b/test/lua-Harness-tests/202-expr.t
> @@ -28,7 +28,7 @@ L<https://www.lua.org/manual/5.4/manual.html#3.4>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local nocvtn2s = profile.nocvtn2s
> local nocvts2n = profile.nocvts2n
> diff --git a/test/lua-Harness-tests/203-lexico.t b/test/lua-Harness-tests/203-lexico.t
> index c1abebf..0a73f8c 100755
> --- a/test/lua-Harness-tests/203-lexico.t
> +++ b/test/lua-Harness-tests/203-lexico.t
> @@ -31,7 +31,7 @@ L<https://www.lua.org/manual/5.4/manual.html#3.1>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local loadstring = loadstring or load
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> 
> @@ -117,20 +117,24 @@ do
>     like(msg, "^[^:]+:%d+: unfinished long comment .-near")
> end
> 
> +-- Adapt tests for testing with Tarantool's out of source build
> +-- on read only file system. CUR_SOURCE_DIR is set via CMake.
> +local path_to_sources = os.getenv('CUR_SOURCE_DIR') .. '/'
> +
> if _VERSION >= 'Lua 5.2' or jit then
> -    dofile'lexico52/lexico.t'
> +    dofile(path_to_sources .. 'lexico52/lexico.t')
> end
> 
> if _VERSION >= 'Lua 5.3' or luajit21 then
> -    dofile'lexico53/lexico.t'
> +    dofile(path_to_sources .. 'lexico53/lexico.t')
> end
> 
> if _VERSION >= 'Lua 5.4' then
> -    dofile'lexico54/lexico.t'
> +    dofile(path_to_sources .. 'lexico54/lexico.t')
> end
> 
> if jit and pcall(require, 'ffi') then
> -    dofile'lexicojit/lexico.t'
> +    dofile(path_to_sources .. 'lexicojit/lexico.t')
> end
> 
> done_testing()
> diff --git a/test/lua-Harness-tests/204-grammar.t b/test/lua-Harness-tests/204-grammar.t
> index d9ae3a6..03580f4 100755
> --- a/test/lua-Harness-tests/204-grammar.t
> +++ b/test/lua-Harness-tests/204-grammar.t
> @@ -28,7 +28,7 @@ L<https://www.lua.org/manual/5.4/manual.html#9>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_goto = _VERSION >= 'Lua 5.2' or jit
> local has_attr = _VERSION >= 'Lua 5.4'
> diff --git a/test/lua-Harness-tests/211-scope.t b/test/lua-Harness-tests/211-scope.t
> index 64eed52..8e26a6f 100755
> --- a/test/lua-Harness-tests/211-scope.t
> +++ b/test/lua-Harness-tests/211-scope.t
> @@ -30,7 +30,7 @@ See section "Local Variables and Blocks" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(10)
> 
> diff --git a/test/lua-Harness-tests/212-function.t b/test/lua-Harness-tests/212-function.t
> index 2851053..405035e 100755
> --- a/test/lua-Harness-tests/212-function.t
> +++ b/test/lua-Harness-tests/212-function.t
> @@ -30,7 +30,7 @@ See section "Functions" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local loadstring = loadstring or load
> 
> plan(68)
> diff --git a/test/lua-Harness-tests/213-closure.t b/test/lua-Harness-tests/213-closure.t
> index fc3bd29..16a8a21 100755
> --- a/test/lua-Harness-tests/213-closure.t
> +++ b/test/lua-Harness-tests/213-closure.t
> @@ -24,7 +24,7 @@ See section "Closures" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(15)
> 
> diff --git a/test/lua-Harness-tests/214-coroutine.t b/test/lua-Harness-tests/214-coroutine.t
> index 92929e1..1ca1cb5 100755
> --- a/test/lua-Harness-tests/214-coroutine.t
> +++ b/test/lua-Harness-tests/214-coroutine.t
> @@ -30,7 +30,7 @@ See section "Coroutines" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> local has_coroutine52 = _VERSION >= 'Lua 5.2' or jit
> diff --git a/test/lua-Harness-tests/221-table.t b/test/lua-Harness-tests/221-table.t
> index c064a33..07ac952 100755
> --- a/test/lua-Harness-tests/221-table.t
> +++ b/test/lua-Harness-tests/221-table.t
> @@ -24,7 +24,7 @@ See section "Tables" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(25)
> 
> diff --git a/test/lua-Harness-tests/222-constructor.t b/test/lua-Harness-tests/222-constructor.t
> index a01be2e..28037bf 100755
> --- a/test/lua-Harness-tests/222-constructor.t
> +++ b/test/lua-Harness-tests/222-constructor.t
> @@ -30,7 +30,7 @@ See section "Table Constructors" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(16)
> 
> diff --git a/test/lua-Harness-tests/223-iterator.t b/test/lua-Harness-tests/223-iterator.t
> index 777ad73..073f3cd 100755
> --- a/test/lua-Harness-tests/223-iterator.t
> +++ b/test/lua-Harness-tests/223-iterator.t
> @@ -25,7 +25,7 @@ section "Coroutines as Iterators" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(8)
> 
> diff --git a/test/lua-Harness-tests/231-metatable.t b/test/lua-Harness-tests/231-metatable.t
> index a2c6499..b94f608 100755
> --- a/test/lua-Harness-tests/231-metatable.t
> +++ b/test/lua-Harness-tests/231-metatable.t
> @@ -30,7 +30,7 @@ See section "Metatables and Metamethods" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_metamethod52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
> local has_metamethod_ipairs = _VERSION == 'Lua 5.2' or profile.compat52 or profile.luajit_compat52
> diff --git a/test/lua-Harness-tests/232-object.t b/test/lua-Harness-tests/232-object.t
> index 0d87572..0d22232 100755
> --- a/test/lua-Harness-tests/232-object.t
> +++ b/test/lua-Harness-tests/232-object.t
> @@ -24,7 +24,7 @@ See section "Object-Oriented Programming" in "Programming in Lua".
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> plan(18)
> 
> diff --git a/test/lua-Harness-tests/241-standalone.t b/test/lua-Harness-tests/241-standalone.t
> index c5237ee..33d5159 100755
> --- a/test/lua-Harness-tests/241-standalone.t
> +++ b/test/lua-Harness-tests/241-standalone.t
> @@ -28,7 +28,7 @@ L<https://www.lua.org/manual/5.4/manual.html#7>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local has_bytecode = not ujit and not ravi
> local has_error52 = _VERSION >= 'Lua 5.2'
> local has_error53 = _VERSION >= 'Lua 5.3'
> @@ -228,14 +228,14 @@ end
> like(f:read'*l', "^usage: ", "no file")
> f:close()
> 
> -cmd = lua .. [[ -ltap -e "print(type(ok))"]]
> +cmd = lua .. [[ -ltap_harness -e "print(type(ok))"]]
> f = io.popen(cmd)
> -is(f:read'*l', 'function', "-ltap")
> +is(f:read'*l', 'function', "-ltap_harness")
> f:close()
> 
> -cmd = lua .. [[ -l tap -e "print(type(ok))"]]
> +cmd = lua .. [[ -l tap_harness -e "print(type(ok))"]]
> f = io.popen(cmd)
> -is(f:read'*l', 'function', "-l tap")
> +is(f:read'*l', 'function', "-l tap_harness")
> f:close()
> 
> cmd = lua .. [[ -l lpeg -e "print(1)" 2>&1]]
> diff --git a/test/lua-Harness-tests/242-luac.t b/test/lua-Harness-tests/242-luac.t
> index a95a334..9a3a3c3 100755
> --- a/test/lua-Harness-tests/242-luac.t
> +++ b/test/lua-Harness-tests/242-luac.t
> @@ -28,7 +28,7 @@ L<https://www.lua.org/manual/5.4/manual.html#7>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> if jit then
>     skip_all("LuaJIT")
> diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t
> index f4f9235..13472cd 100755
> --- a/test/lua-Harness-tests/301-basic.t
> +++ b/test/lua-Harness-tests/301-basic.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.1>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_error53 = _VERSION >= 'Lua 5.3'
> local has_gcinfo = _VERSION == 'Lua 5.1'
> @@ -843,7 +843,10 @@ do -- xpcall
> end
> 
> if jit and pcall(require, 'ffi') then
> -    dofile'lexicojit/basic.t'
> +    -- Adapt test for testing with Tarantool's out of source build
> +    -- on read only file system. CUR_SOURCE_DIR is set via CMake.
> +    local path_to_sources = os.getenv('CUR_SOURCE_DIR')
> +    dofile(path_to_sources .. '/lexicojit/basic.t')
> end
> 
> done_testing()
> diff --git a/test/lua-Harness-tests/303-package.t b/test/lua-Harness-tests/303-package.t
> index 7e5216d..996ce22 100755
> --- a/test/lua-Harness-tests/303-package.t
> +++ b/test/lua-Harness-tests/303-package.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.3>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> local has_loaders = _VERSION == 'Lua 5.1'
> @@ -130,9 +130,9 @@ end
> 
> -- searchpath
> if has_searcherpath then
> -    local p = package.searchpath('tap', package.path)
> +    local p = package.searchpath('tap_harness', package.path)
>     type_ok(p, 'string', "searchpath")
> -    p = package.searchpath('tap', 'bad path')
> +    p = package.searchpath('tap_harness', 'bad path')
>     is(p, nil)
> else
>     is(package.searchpath, nil, "no package.searchpath")
> diff --git a/test/lua-Harness-tests/304-string.t b/test/lua-Harness-tests/304-string.t
> index 991600a..293fd8e 100755
> --- a/test/lua-Harness-tests/304-string.t
> +++ b/test/lua-Harness-tests/304-string.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.4>
> 
> ]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> local has_dump53 = _VERSION >= 'Lua 5.3' or jit
> diff --git a/test/lua-Harness-tests/305-utf8.t b/test/lua-Harness-tests/305-utf8.t
> index 4304b6c..59a2e6b 100755
> --- a/test/lua-Harness-tests/305-utf8.t
> +++ b/test/lua-Harness-tests/305-utf8.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.5>
> 
> --]]
> 
> -require 'tap'
> +require'tap_harness'
> 
> local profile = require'profile'
> local has_utf8 = _VERSION >= 'Lua 5.3' or (jit and jit.version:match'moonjit') or profile.utf8
> diff --git a/test/lua-Harness-tests/306-table.t b/test/lua-Harness-tests/306-table.t
> index 9836655..6e76492 100755
> --- a/test/lua-Harness-tests/306-table.t
> +++ b/test/lua-Harness-tests/306-table.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.6>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> local has_foreach = _VERSION == 'Lua 5.1'
> diff --git a/test/lua-Harness-tests/307-math.t b/test/lua-Harness-tests/307-math.t
> index 8b51ed1..762567f 100755
> --- a/test/lua-Harness-tests/307-math.t
> +++ b/test/lua-Harness-tests/307-math.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.7>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_integer = _VERSION >= 'Lua 5.3' or (jit and jit.version:match'moonjit') or profile.integer
> local has_mathx = _VERSION < 'Lua 5.3' or profile.compat52 or profile.compat53 or profile.has_mathx
> diff --git a/test/lua-Harness-tests/308-io.t b/test/lua-Harness-tests/308-io.t
> index 35d39c0..1945ce3 100755
> --- a/test/lua-Harness-tests/308-io.t
> +++ b/test/lua-Harness-tests/308-io.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.8>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> local has_write51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit)
> diff --git a/test/lua-Harness-tests/309-os.t b/test/lua-Harness-tests/309-os.t
> index a787b14..f94db00 100755
> --- a/test/lua-Harness-tests/309-os.t
> +++ b/test/lua-Harness-tests/309-os.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.9>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 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)
> diff --git a/test/lua-Harness-tests/310-debug.t b/test/lua-Harness-tests/310-debug.t
> index f78af03..63194ac 100755
> --- a/test/lua-Harness-tests/310-debug.t
> +++ b/test/lua-Harness-tests/310-debug.t
> @@ -30,7 +30,7 @@ L<https://www.lua.org/manual/5.4/manual.html#6.10>
> 
> ]]
> 
> -require 'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_getfenv = _VERSION == 'Lua 5.1'
> local has_gethook54 = _VERSION >= 'Lua 5.4'
> diff --git a/test/lua-Harness-tests/311-bit32.t b/test/lua-Harness-tests/311-bit32.t
> index 7023906..a314f47 100755
> --- a/test/lua-Harness-tests/311-bit32.t
> +++ b/test/lua-Harness-tests/311-bit32.t
> @@ -29,7 +29,7 @@ L<https://www.lua.org/manual/5.2/manual.html#6.7>
> 
> --]]
> 
> -require 'tap'
> +require'tap_harness'
> local profile = require'profile'
> local has_bit32 = _VERSION == 'Lua 5.2' or profile.compat52 or profile.has_bit32
> 
> diff --git a/test/lua-Harness-tests/314-regex.t b/test/lua-Harness-tests/314-regex.t
> index ad4554c..ac7ad80 100755
> --- a/test/lua-Harness-tests/314-regex.t
> +++ b/test/lua-Harness-tests/314-regex.t
> @@ -49,7 +49,7 @@ Description of the test.
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local loadstring = loadstring or load
> 
> plan(162)
> diff --git a/test/lua-Harness-tests/320-stdin.t b/test/lua-Harness-tests/320-stdin.t
> index 4828285..a0eabcb 100755
> --- a/test/lua-Harness-tests/320-stdin.t
> +++ b/test/lua-Harness-tests/320-stdin.t
> @@ -24,7 +24,7 @@ Tests Lua Basic & IO Libraries with stdin
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> 
> local lua = get_lua_binary_name()
> 
> diff --git a/test/lua-Harness-tests/401-bitop.t b/test/lua-Harness-tests/401-bitop.t
> index f95aebf..d1225bd 100755
> --- a/test/lua-Harness-tests/401-bitop.t
> +++ b/test/lua-Harness-tests/401-bitop.t
> @@ -24,7 +24,7 @@ See L<http://bitop.luajit.org/>.
> 
> --]]
> 
> -require 'tap'
> +require'tap_harness'
> 
> if not jit then
>     skip_all("only with LuaJIT")
> diff --git a/test/lua-Harness-tests/402-ffi.t b/test/lua-Harness-tests/402-ffi.t
> index a2e32a5..2423b2e 100755
> --- a/test/lua-Harness-tests/402-ffi.t
> +++ b/test/lua-Harness-tests/402-ffi.t
> @@ -24,7 +24,7 @@ See L<http://luajit.org/ext_ffi.html>.
> 
> --]]
> 
> -require 'tap'
> +require'tap_harness'
> 
> if not jit then
>     skip_all("only with LuaJIT")
> diff --git a/test/lua-Harness-tests/403-jit.t b/test/lua-Harness-tests/403-jit.t
> index 0073c90..6c0870a 100755
> --- a/test/lua-Harness-tests/403-jit.t
> +++ b/test/lua-Harness-tests/403-jit.t
> @@ -24,7 +24,7 @@ See L<http://luajit.org/ext_jit.html>.
> 
> --]]
> 
> -require 'tap'
> +require'tap_harness'
> local profile = require'profile'
> 
> if not jit then
> diff --git a/test/lua-Harness-tests/404-ext.t b/test/lua-Harness-tests/404-ext.t
> index 22a52c7..906ed51 100755
> --- a/test/lua-Harness-tests/404-ext.t
> +++ b/test/lua-Harness-tests/404-ext.t
> @@ -24,7 +24,7 @@ See L<http://luajit.org/ext_jit.html>.
> 
> --]]
> 
> -require 'tap'
> +require'tap_harness'
> local profile = require'profile'
> 
> local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT')
> diff --git a/test/lua-Harness-tests/411-luajit.t b/test/lua-Harness-tests/411-luajit.t
> index feb752e..b8cb547 100755
> --- a/test/lua-Harness-tests/411-luajit.t
> +++ b/test/lua-Harness-tests/411-luajit.t
> @@ -24,7 +24,7 @@ See L<http://luajit.org/running.html>
> 
> --]]
> 
> -require'tap'
> +require'tap_harness'
> local profile = require'profile'
> 
> if not jit or ujit then
> diff --git a/test/lua-Harness-tests/CMakeLists.txt b/test/lua-Harness-tests/CMakeLists.txt
> index 9b35e5a..e28cadd 100644
> --- a/test/lua-Harness-tests/CMakeLists.txt
> +++ b/test/lua-Harness-tests/CMakeLists.txt
> @@ -26,7 +26,17 @@ string(CONCAT LUA_CPATH
>   "${LUAJIT_SOURCE_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;"
> )
> 
> -add_custom_target(lua-Harness-tests DEPENDS ${LUAJIT_TEST_BINARY})
> +# FIXME: Until https://github.com/tarantool/tarantool/issues/5040
> +# is resolved, Tarantool enters interactive mode if prove input
> +# is not stdin. As a result test hungs and not run at all.
> +# This part should be dropped, and argument to prove is passed
> +# as directory.
> +file(GLOB TESTS_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.t)
> +string(REPLACE ";" "\n" TESTS_LIST "${TESTS_LIST}")
> +set(LIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/tests_list)
> +file(WRITE ${LIST_FILE} ${TESTS_LIST})
> +
> +add_custom_target(lua-Harness-tests DEPENDS ${LUAJIT_TEST_BINARY} ${LIST_FILE})
> 
> add_custom_command(TARGET lua-Harness-tests
>   COMMENT "Running lua-Harness tests"
> @@ -40,7 +50,10 @@ add_custom_command(TARGET lua-Harness-tests
>     # for more info.
>     # So use less preferable way for tests.
>     # See the root CMakeLists.txt for more info.
> -    ${PROVE} ${CMAKE_CURRENT_SOURCE_DIR}
> +    # XXX: Adapt to run test witht Tarantool on read-only
> +    # file systems with dofile(CUR_SOURCE_DIR..filename).
> +    CUR_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
> +    ${PROVE} - < ${LIST_FILE}
>       --exec '${LUAJIT_TEST_COMMAND} -l profile_luajit21'
>       ${LUA_TEST_FLAGS}
>   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
> diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap_harness.lua
> similarity index 100%
> rename from test/lua-Harness-tests/tap.lua
> rename to test/lua-Harness-tests/tap_harness.lua
> -- 
> 2.28.0
> 


  reply	other threads:[~2021-03-13 18:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12  5:27 [Tarantool-patches] [PATCH luajit 0/6] Adapt lua-Harness test suite Sergey Kaplun via Tarantool-patches
2021-03-12  5:27 ` [Tarantool-patches] [PATCH luajit 1/6] test: add " Sergey Kaplun via Tarantool-patches
2021-03-15 13:05   ` Igor Munkin via Tarantool-patches
2021-03-12  5:27 ` [Tarantool-patches] [PATCH luajit 2/6] test: adjust lua-Harness test suite for Tarantool Sergey Kaplun via Tarantool-patches
2021-03-13 18:41   ` Sergey Ostanevich via Tarantool-patches [this message]
2021-03-15 13:22   ` Igor Munkin via Tarantool-patches
2021-03-12  5:27 ` [Tarantool-patches] [PATCH luajit 3/6] test: disable 305-utf8 of lua-Harness suite Sergey Kaplun via Tarantool-patches
2021-03-13 18:45   ` Sergey Ostanevich via Tarantool-patches
2021-03-15 12:45   ` Igor Munkin via Tarantool-patches
2021-03-12  5:27 ` [Tarantool-patches] [PATCH luajit 4/6] test: disable 241-standalone " Sergey Kaplun via Tarantool-patches
2021-03-13 18:45   ` Sergey Ostanevich via Tarantool-patches
2021-03-15 12:47   ` Igor Munkin via Tarantool-patches
2021-03-12  5:27 ` [Tarantool-patches] [PATCH luajit 5/6] test: disable 411-luajit " Sergey Kaplun via Tarantool-patches
2021-03-13 18:46   ` Sergey Ostanevich via Tarantool-patches
2021-03-15 12:48   ` Igor Munkin via Tarantool-patches
2021-03-12  5:27 ` [Tarantool-patches] [PATCH luajit 6/6] test: skip test for getenv in 309-os.t Sergey Kaplun via Tarantool-patches
2021-03-13 18:50   ` Sergey Ostanevich via Tarantool-patches
2021-03-15 10:22     ` Igor Munkin via Tarantool-patches
2021-03-13 18:22 ` [Tarantool-patches] [PATCH luajit 0/6] Adapt lua-Harness test suite Sergey Ostanevich 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=17DBB8DA-FF25-464A-A187-6E1D6AFB1954@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 2/6] test: adjust lua-Harness test suite for Tarantool' \
    /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