[Tarantool-patches] [PATCH v2 luajit 08/26] test: enable <ffi_const.lua> in LuaJIT-tests

Maxim Kokryashkin m.kokryashkin at tarantool.org
Wed Jan 31 17:32:20 MSK 2024


Hi, Sergey!
Thanks for the patch!
LGTM, except for the question below.
On Mon, Jan 29, 2024 at 01:45:08PM +0300, Sergey Kaplun wrote:
> This patch changes the `dofile()` (which uses an unreliable relative
> file path and mutates `_G` with global functions to be defined) to the
> corresponding `require()`.  Also, it names the only one test as "misc"
> and includes the test in <index>.
>
> Part of tarantool/tarantool#9398
> ---
>  test/LuaJIT-tests/lib/ffi/ffi_const.lua | 4 ++--
>  test/LuaJIT-tests/lib/ffi/index         | 1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/test/LuaJIT-tests/lib/ffi/ffi_const.lua b/test/LuaJIT-tests/lib/ffi/ffi_const.lua
> index d42133ad..3213156d 100644
> --- a/test/LuaJIT-tests/lib/ffi/ffi_const.lua
> +++ b/test/LuaJIT-tests/lib/ffi/ffi_const.lua
> @@ -1,6 +1,6 @@
>  local ffi = require("ffi")
>
> -dofile("../common/ffi_util.inc")
> +local fails = require("common.fails")
>
>  ffi.cdef[[
>  typedef struct s_t {
> @@ -41,7 +41,7 @@ typedef struct foo_t {
>  } foo_t;
>  ]]
>
> -do
> +do --- misc
Again, maybe it is worth splitting into the subcategories that are
mentioned below.
>    local foo_t = ffi.typeof("foo_t")
>    local x = foo_t()
>
> diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index
> index 9a22104a..0a72daed 100644
> --- a/test/LuaJIT-tests/lib/ffi/index
> +++ b/test/LuaJIT-tests/lib/ffi/index
> @@ -6,6 +6,7 @@ ffi_arith_ptr.lua
>  ffi_bitfield.lua
>  ffi_call.lua
>  ffi_callback.lua
> +ffi_const.lua
>  istype.lua
>  jit_array.lua
>  jit_complex.lua
> --
> 2.43.0
>


More information about the Tarantool-patches mailing list