[Tarantool-patches] [PATCH v2 luajit 20/26] test: enable <ffi_parse_cdef.lua> in LuaJIT-tests
Maxim Kokryashkin
m.kokryashkin at tarantool.org
Thu Feb 1 12:05:43 MSK 2024
Hi, Sergey!
Thanks for the patch!
Please consider my comments below.
On Mon, Jan 29, 2024 at 01:45:20PM +0300, Sergey Kaplun wrote:
> This patch changes `dofile()` (which uses an unreliable relative file
> path and mutates `_G` with global functions to be defined) to the
> corresponding `require()` of the helper functions. It adds groups with
> the names of subtests and enables the test in <index>.
>
> Part of tarantool/tarantool#9398
> ---
> test/LuaJIT-tests/lib/ffi/ffi_parse_cdef.lua | 141 ++++++++++---------
> test/LuaJIT-tests/lib/ffi/index | 1 +
> 2 files changed, 77 insertions(+), 65 deletions(-)
>
> diff --git a/test/LuaJIT-tests/lib/ffi/ffi_parse_cdef.lua b/test/LuaJIT-tests/lib/ffi/ffi_parse_cdef.lua
> index 4bb5d903..cc123808 100644
> --- a/test/LuaJIT-tests/lib/ffi/ffi_parse_cdef.lua
> +++ b/test/LuaJIT-tests/lib/ffi/ffi_parse_cdef.lua
> @@ -1,77 +1,88 @@
> local ffi = require("ffi")
>
> -dofile("../common/ffi_util.inc")
> +local checkfail = require("common.ffi.checkfail")
> +local checktypes = require("common.ffi.checktypes")
>
> -checkfail({
> - "int",
> - "int aa1; int aa2 ",
> - "static int x;",
> - "static const long long x = 1;", -- NYI
> - "static const double x = 1;", -- NYI
> - "static const bool x = 1;", -- NYI (intentional, need true/false)
> - "struct { static int x = 1; };",
> - ";;static int y"
> -}, ffi.cdef)
> +do --- checkfail
More elaborate name would be nice.
> + checkfail({
> + "int",
> + "int aa1; int aa2 ",
> + "static int x;",
> + "static const long long x = 1;", -- NYI
> + "static const double x = 1;", -- NYI
> + "static const bool x = 1;", -- NYI (intentional, need true/false)
> + "struct { static int x = 1; };",
> + ";;static int y"
> + }, ffi.cdef)
> +end
<snipped>
More information about the Tarantool-patches
mailing list