From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Igor Munkin <imun@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit 6/7] test: fix lua-Harness JIT-related tests Date: Tue, 14 Feb 2023 15:42:07 +0300 [thread overview] Message-ID: <Y+uBn3VMt5ETrhjk@root> (raw) In-Reply-To: <f61de137a4cf78b5f396c3d72a67855bbee5837f.1676304797.git.imun@tarantool.org> Hi, Igor! Thanks for the patch! Please, consider my comment below. On 13.02.23, Igor Munkin wrote: > lua-Harness consider whether JIT is enabled or not in scope of 403-jit.t > and 411-luajit.t tests. However, the original condition is wrong, since > <jit.status> yields false for both cases, when JIT is just turned off > and when LuaJIT is build without compiler support. So if <jit.status> Typo: s/So/So,/ > yields false, the latter case is considered. The condition is fixed to > differ both aforementioned cases the following way: when <jit.status> Typo? s/to differ ... cases the following way/to differ ... cases in the following way/ > yields only compiler status with no flags listing, LuaJIT is built > without compiler; if there is more than one value returned, JIT support > is on aboard. I afraid that this check isn't fully correct either: `jit.status()` yields CPU-specific flags and JIT optimization flags. For ARM64 the subset of CPU-specific flags is empty. Hence, if someone runs the tests with `jit.opt.start(0)` to disable all JIT optimization this check will return false for LuaJIT compiled with JIT. | $ src/luajit -e 'jit.opt.start(0) print(jit.arch, jit.status(), select("#", jit.status()) > 1)' | arm64 true false Also, I found the easier way to check `LJ_HASJIT` is set or not. We can simply check the existance of `jit.opt` module: | $ src/luajit -e 'print(jit.opt)' | nil > > Part of tarantool/tarantool#8252 > > Signed-off-by: Igor Munkin <imun@tarantool.org> > --- > test/lua-Harness-tests/403-jit.t | 2 +- > test/lua-Harness-tests/411-luajit.t | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/test/lua-Harness-tests/403-jit.t b/test/lua-Harness-tests/403-jit.t > index 0f986da9..0aa5d367 100755 > --- a/test/lua-Harness-tests/403-jit.t > +++ b/test/lua-Harness-tests/403-jit.t > @@ -31,7 +31,7 @@ if not jit then > skip_all("only with LuaJIT") > end > > -local compiled_with_jit = jit.status() > +local compiled_with_jit = select('#', jit.status()) > 1 > local luajit20 = jit.version_num < 20100 and not jit.version:match'RaptorJIT' > local has_jit_opt = compiled_with_jit > local has_jit_security = jit.security > diff --git a/test/lua-Harness-tests/411-luajit.t b/test/lua-Harness-tests/411-luajit.t > index 3a9a7b8f..e3b6c7a8 100755 > --- a/test/lua-Harness-tests/411-luajit.t > +++ b/test/lua-Harness-tests/411-luajit.t > @@ -37,7 +37,7 @@ if not pcall(io.popen, lua .. [[ -e "a=1"]]) then > skip_all("io.popen not supported") > end > > -local compiled_with_jit = jit.status() > +local compiled_with_jit = select('#', jit.status()) > 1 > local has_jutil = pcall(require, 'jit.util') > local has_openresty_listing = profile.openresty or jit.version:match'moonjit' > > -- > 2.30.2 > -- Best regards, Sergey Kaplun
next prev parent reply other threads:[~2023-02-14 12:45 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-13 17:02 [Tarantool-patches] [PATCH luajit 0/7] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 1/7] Minor fixes Igor Munkin via Tarantool-patches 2023-02-13 18:47 ` Sergey Kaplun via Tarantool-patches 2023-02-14 13:51 ` Maxim Kokryashkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 2/7] build: fix build with JIT disabled Igor Munkin via Tarantool-patches 2023-02-13 18:53 ` Sergey Kaplun via Tarantool-patches 2023-02-27 9:15 ` Igor Munkin via Tarantool-patches 2023-02-28 8:16 ` Maxim Kokryashkin via Tarantool-patches 2023-02-14 13:53 ` Maxim Kokryashkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 3/7] test: stop using utils.selfrun in tests Igor Munkin via Tarantool-patches 2023-02-15 8:08 ` Sergey Kaplun via Tarantool-patches 2023-02-27 9:16 ` Igor Munkin via Tarantool-patches 2023-02-27 9:28 ` Sergey Kaplun via Tarantool-patches 2023-02-15 21:43 ` Maxim Kokryashkin via Tarantool-patches 2023-02-27 9:16 ` Igor Munkin via Tarantool-patches 2023-02-28 8:18 ` Maxim Kokryashkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 4/7] test: make skipcond helper more convenient Igor Munkin via Tarantool-patches 2023-02-15 8:46 ` Sergey Kaplun via Tarantool-patches 2023-02-27 9:18 ` Igor Munkin via Tarantool-patches 2023-02-27 10:09 ` Sergey Kaplun via Tarantool-patches 2023-02-28 8:27 ` Maxim Kokryashkin via Tarantool-patches 2023-02-15 22:08 ` Maxim Kokryashkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 5/7] test: add skipcond for all JIT-related tests Igor Munkin via Tarantool-patches 2023-02-14 13:50 ` Sergey Kaplun via Tarantool-patches 2023-02-15 22:31 ` Maxim Kokryashkin via Tarantool-patches 2023-02-28 19:02 ` Igor Munkin via Tarantool-patches 2023-03-01 19:31 ` Maxim Kokryashkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 6/7] test: fix lua-Harness " Igor Munkin via Tarantool-patches 2023-02-14 12:42 ` Sergey Kaplun via Tarantool-patches [this message] 2023-02-28 19:01 ` Igor Munkin via Tarantool-patches 2023-02-15 22:35 ` Maxim Kokryashkin via Tarantool-patches 2023-02-28 19:02 ` Igor Munkin via Tarantool-patches 2023-03-01 19:31 ` Maxim Kokryashkin via Tarantool-patches 2023-02-13 17:02 ` [Tarantool-patches] [PATCH luajit 7/7] ci: add nojit flavor for exotic builds Igor Munkin via Tarantool-patches 2023-02-13 19:14 ` Sergey Kaplun via Tarantool-patches 2023-02-15 21:18 ` Maxim Kokryashkin via Tarantool-patches 2023-02-27 9:36 ` [Tarantool-patches] [PATCH luajit 0/7] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches 2023-02-28 19:05 ` Igor Munkin 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=Y+uBn3VMt5ETrhjk@root \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit 6/7] test: fix lua-Harness JIT-related tests' \ /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