[Tarantool-patches] [PATCH luajit 1/3] test: split utils.lua into several modules

Sergey Kaplun skaplun at tarantool.org
Wed Jun 28 14:36:30 MSK 2023


Hi, Igor!
Thanks for the patch!
Yes, splitting of the testing utils sounds like a good idea, indeed!
With these changes all code becomes more organized.

The patch itself LGTM, except a few nits regarding the commit message.

On 27.06.23, Igor Munkin wrote:
> The next patch introduces a separate JIT-related module with convenient
> utils for JIT engine testing. Considering this change it looks vital to
> make a structured utils distributed module instead of "all in one" Lua
> chunk. As a result the original utils.lua is split into the several

Typo: s/As a result/As a result,/

> modules per subsystem to be tested (e.g. GC, frontend, profilers, etc.).
> 
> Lazy loading of the introduced submodules allows to use this utils in
> all test chunks regardless LuaJIT configuration (e.g. with JIT engine

Typo: s/JIT engine/the JIT engine/

> disabled, without FFI support, etc) and do not spoil utils table with

Typo: s/etc/etc./

> the excess helpers.
> 
> Signed-off-by: Igor Munkin <imun at tarantool.org>
> ---
> 
> Sergey, considering the changes you've made in the second patch, I
> propose to finally split utils.lua into submodules that loads lazily.
> I've pushed my commit on your branch prior to your patchset. If you have
> some notes regarding this, please share them. Otherwise, I'll push this
> into the LuaJIT long-term branches.
> 
> 
> You can also find the trivial changes made within your commits below:
> 
> ================================================================================
> 
> diff --git a/test/tarantool-tests/lj-981-folding-0.test.lua b/test/tarantool-tests/lj-981-folding-0.test.lua
> index 64473ba3..d156f53d 100644
> --- a/test/tarantool-tests/lj-981-folding-0.test.lua
> +++ b/test/tarantool-tests/lj-981-folding-0.test.lua

<snipped>

> diff --git a/test/tarantool-tests/unit-jit-parse.test.lua b/test/tarantool-tests/unit-jit-parse.test.lua
> index e9c0bb80..e4445bf4 100644
> --- a/test/tarantool-tests/unit-jit-parse.test.lua
> +++ b/test/tarantool-tests/unit-jit-parse.test.lua

<snipped>

> ================================================================================
> 
>  test/tarantool-tests/CMakeLists.txt           |   2 +-
>  .../bc-jit-unpatching.test.lua                |   5 +-
>  .../fix-gc-setupvalue.test.lua                |   4 +-
>  .../gh-4427-ffi-sandwich.test.lua             |   2 +-
>  .../gh-5813-resolving-of-c-symbols.test.lua   |   2 +-
>  ...-missed-carg1-in-bctsetr-fallback.test.lua |   2 +-
>  .../lj-351-print-tostring-number.test.lua     |   2 +-
>  .../lj-586-debug-non-string-error.test.lua    |   2 +-
>  .../lj-flush-on-trace.test.lua                |   2 +-
>  .../misclib-getmetrics-lapi.test.lua          |   2 +-
>  .../misclib-memprof-lapi.test.lua             |   2 +-
>  .../misclib-sysprof-lapi.test.lua             |   2 +-
>  test/tarantool-tests/utils.lua                | 125 ------------------
>  test/tarantool-tests/utils/exec.lua           |  52 ++++++++
>  test/tarantool-tests/utils/frontend.lua       |  25 ++++
>  test/tarantool-tests/utils/gc.lua             |  33 +++++
>  test/tarantool-tests/utils/init.lua           |   7 +
>  test/tarantool-tests/utils/jit/const.lua      |   8 ++
>  test/tarantool-tests/utils/jit/init.lua       |   7 +
>  test/tarantool-tests/utils/tools.lua          |  15 +++
>  20 files changed, 162 insertions(+), 139 deletions(-)
>  delete mode 100644 test/tarantool-tests/utils.lua
>  create mode 100644 test/tarantool-tests/utils/exec.lua
>  create mode 100644 test/tarantool-tests/utils/frontend.lua
>  create mode 100644 test/tarantool-tests/utils/gc.lua
>  create mode 100644 test/tarantool-tests/utils/init.lua
>  create mode 100644 test/tarantool-tests/utils/jit/const.lua
>  create mode 100644 test/tarantool-tests/utils/jit/init.lua
>  create mode 100644 test/tarantool-tests/utils/tools.lua
> 
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index 527905b6..14a98cf2 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -75,7 +75,7 @@ add_subdirectory(lj-flush-on-trace)
>  # directory), so LUA_PATH need to be updated.
>  make_lua_path(LUA_PATH
>    PATHS
> -    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
> +    ${CMAKE_CURRENT_SOURCE_DIR}/?/init.lua

Side note: see updates in the second mail.

>      ${PROJECT_SOURCE_DIR}/tools/?.lua
>      ${LUAJIT_SOURCE_DIR}/?.lua
>      ${LUAJIT_BINARY_DIR}/?.lua
> diff --git a/test/tarantool-tests/bc-jit-unpatching.test.lua b/test/tarantool-tests/bc-jit-unpatching.test.lua

<snipped>

> -- 
> 2.30.2
> 

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list