Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 5/7] test: add skipcond for all JIT-related tests
Date: Mon, 13 Feb 2023 17:02:47 +0000	[thread overview]
Message-ID: <f8bde7cd2e4cf39951db5536df5cc981d99b6e5f.1676304797.git.imun@tarantool.org> (raw)
In-Reply-To: <cover.1676304797.git.imun@tarantool.org>

This patch adjusts all tests for JIT engine to avoid failures when JIT
is disabled, so skipcond with the result of <jit.status> as a condition
is added to handle this.

Part of tarantool/tarantool#8252

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 .../bc-jit-unpatching.test.lua                |  6 +++--
 .../fix-fold-simplify-conv-sext.test.lua      |  7 ++---
 .../fix-slot-check-for-mm-record.test.lua     |  4 ++-
 .../gh-4199-gc64-fuse.test.lua                |  1 +
 .../gh-4427-ffi-sandwich.test.lua             |  1 +
 ...gh-4476-fix-string-find-recording.test.lua |  4 ++-
 .../gh-6065-jit-library-smoke-tests.test.lua  |  4 ++-
 ...8-fix-side-exit-patching-on-arm64.test.lua |  5 +++-
 test/tarantool-tests/gh-6189-cur_L.test.lua   |  7 +++--
 ...ytecode-allocator-for-comparisons.test.lua |  5 +++-
 .../gh-6371-string-char-no-arg.test.lua       |  5 ++--
 ...6782-stitching-in-vmevent-handler.test.lua |  6 +++--
 .../gh-6976-narrowing-of-unary-minus.test.lua |  5 +++-
 ...4-add-proto-trace-sysprof-default.test.lua |  1 +
 .../lj-350-sload-typecheck.test.lua           |  8 +++---
 .../lj-356-ir-khash-non-string-obj.test.lua   | 11 +++++---
 .../lj-357-arm64-hrefk.test.lua               |  6 +++--
 .../lj-375-ir-bufput-signed-char.test.lua     |  4 ++-
 .../lj-408-tonumber-cdata-record.test.lua     | 11 ++++----
 .../lj-416-xor-before-jcc.test.lua            |  6 +++--
 .../lj-430-maxirconst.test.lua                |  1 +
 ...lj-505-fold-no-strref-for-ptrdiff.test.lua |  4 ++-
 .../lj-524-fold-conv-respect-src-irt.test.lua |  6 +++--
 .../lj-556-fix-loop-realignment.test.lua      |  4 ++-
 ...j-584-bad-renames-for-sunk-values.test.lua |  4 ++-
 .../lj-603-err-snap-restore.test.lua          |  1 +
 ...lj-672-cdata-allocation-recording.test.lua |  1 +
 .../lj-864-varg-rec-base-offset.test.lua      |  6 +++--
 .../lj-flush-on-trace.test.lua                |  1 +
 .../misclib-getmetrics-capi.test.lua          |  1 +
 .../misclib-getmetrics-lapi.test.lua          |  1 +
 .../misclib-memprof-lapi.test.lua             | 26 +++++++++----------
 .../misclib-sysprof-lapi.test.lua             |  7 ++---
 33 files changed, 112 insertions(+), 58 deletions(-)

diff --git a/test/tarantool-tests/bc-jit-unpatching.test.lua b/test/tarantool-tests/bc-jit-unpatching.test.lua
index 71247f0c..2c3b7c9a 100644
--- a/test/tarantool-tests/bc-jit-unpatching.test.lua
+++ b/test/tarantool-tests/bc-jit-unpatching.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-local utils = require('utils')
+local test = tap.test('bc-jit-unpatching'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('bc-jit-unpatching')
 test:plan(1)
 
+local utils = require('utils')
 -- Function with up-recursion.
 local function f(n)
   return n < 2 and n or f(n - 1) + f(n - 2)
diff --git a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
index 07e22c36..60eb3e7c 100644
--- a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
+++ b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
@@ -1,12 +1,13 @@
 local tap = require('tap')
-local ffi = require('ffi')
-
-local test = tap.test('fix-fold-simplify-conv-sext')
+local test = tap.test('fix-fold-simplify-conv-sext'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
 local NSAMPLES = 4
 local NTEST = NSAMPLES * 2 - 1
 test:plan(NTEST)
 
+local ffi = require('ffi')
 local samples = ffi.new('int [?]', NSAMPLES)
 
 -- Prepare data.
diff --git a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
index 8df72ec4..6161747f 100644
--- a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
+++ b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
@@ -1,7 +1,9 @@
 -- luacheck: globals a0 a1
 local tap = require('tap')
+local test = tap.test('fix-slot-check-for-mm-record'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('fix-slot-check-for-mm-record')
 test:plan(1)
 
 -- Before the patch, JIT compiler doesn't check slots overflow
diff --git a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
index 65f9faac..4513d43b 100644
--- a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
+++ b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('gh-4199-gc64-fuse'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Test requires GC64 mode enabled'] = not require('ffi').abi('gc64'),
 })
 
diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
index 2d6c3b06..ff3eaf01 100644
--- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
+++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('gh-4427-ffi-sandwich'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
index f48af173..0758b38f 100644
--- a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
+++ b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test("gh-4476-fix-string-find-recording"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test("gh-4476-fix-string-find-recording")
 test:plan(1)
 
 local err = [[module 'kit.1.10.3-136' not found:
diff --git a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
index 7110e351..5d7fd7e2 100644
--- a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
+++ b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('gh-6065-jit-library-smoke-tests'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('gh-6065-jit-library-smoke-tests')
 test:plan(1)
 
 -- Just check whether LuaJIT is built with JIT support. Otherwise,
diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
index 4dcf3e22..cfcc6adb 100644
--- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
+++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
@@ -1,5 +1,8 @@
 local tap = require('tap')
-local test = tap.test('gh-6098-fix-side-exit-patching-on-arm64')
+local test = tap.test('gh-6098-fix-side-exit-patching-on-arm64'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 -- The function to be tested for side exit patching:
diff --git a/test/tarantool-tests/gh-6189-cur_L.test.lua b/test/tarantool-tests/gh-6189-cur_L.test.lua
index 7f2184ec..a5096a7c 100644
--- a/test/tarantool-tests/gh-6189-cur_L.test.lua
+++ b/test/tarantool-tests/gh-6189-cur_L.test.lua
@@ -1,9 +1,12 @@
-local libcur_L = require('libcur_L')
 local tap = require('tap')
+local test = tap.test('gh-6189-cur_L'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('gh-6189-cur_L')
 test:plan(1)
 
+local libcur_L = require('libcur_L')
+
 local function cbool(cond)
   if cond then
     return 1
diff --git a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
index 9788923a..da399bcf 100644
--- a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
+++ b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
@@ -1,5 +1,8 @@
 local tap = require('tap')
-local test = tap.test('gh-6227-bytecode-allocator-for-comparisons')
+local test = tap.test('gh-6227-bytecode-allocator-for-comparisons'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 -- Test file to demonstrate assertion failure during recording
diff --git a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
index ec871d19..90121860 100644
--- a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
+++ b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
@@ -1,10 +1,11 @@
 local tap = require('tap')
-
 -- Test file to demonstrate assertion after `string.char()`
 -- recording.
 -- See also, https://github.com/tarantool/tarantool/issues/6371.
+local test = tap.test('gh-6371-string-char-no-arg'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('gh-6371-string-char-no-arg')
 -- XXX: Number of loop iterations.
 -- * 1 -- instruction becomes hot.
 -- * 2 -- recording of the loop body.
diff --git a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
index 6087e5ae..385e7648 100644
--- a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
+++ b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-
 -- Test file to demonstrate incorrect stitching behaviour
 -- in vmevent handler.
 -- See also https://github.com/tarantool/tarantool/issues/6782.
-local test = tap.test('gh-6782-stitching-in-vmevent-handler')
+local test = tap.test('gh-6782-stitching-in-vmevent-handler'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 -- Just dump bytecodes is enough.
diff --git a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
index b4792f59..40387cca 100644
--- a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
+++ b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
@@ -1,5 +1,8 @@
 local tap = require('tap')
-local test = tap.test('gh-6976-narrowing-of-unary-minus')
+local test = tap.test('gh-6976-narrowing-of-unary-minus'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(2)
 
 jit.opt.start('hotloop=1')
diff --git a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
index f139b6b5..bc8f3d94 100644
--- a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
+++ b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('gh-7264-add-proto-trace-sysprof-default'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Sysprof is implemented for x86_64 only'] = jit.arch ~= 'x86' and jit.arch ~= 'x64',
   ['Sysprof is implemented for Linux only'] = jit.os ~= 'Linux',
 })
diff --git a/test/tarantool-tests/lj-350-sload-typecheck.test.lua b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
index 33794943..5b25864d 100644
--- a/test/tarantool-tests/lj-350-sload-typecheck.test.lua
+++ b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
@@ -1,13 +1,15 @@
 local tap = require('tap')
-local traceinfo = require('jit.util').traceinfo
-
 -- Test file to demonstrate the incorrect GC64 JIT asembling
 -- `IR_SLOAD`.
 -- See also https://github.com/LuaJIT/LuaJIT/pull/350.
-local test = tap.test('lj-350-sload-typecheck')
+local test = tap.test('lj-350-sload-typecheck'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
 test:plan(1)
 
+local traceinfo = require('jit.util').traceinfo
+
 -- Contains only IR_SLOAD after recording.
 local function sload(arg)
   return arg
diff --git a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
index 7f304183..9977205d 100644
--- a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
+++ b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
@@ -1,17 +1,20 @@
 local tap = require('tap')
-local traceinfo = require('jit.util').traceinfo
-local table_new = require('table.new')
-
 -- Test file to demonstrate the incorrect GC64 JIT behaviour
 -- of an `IR_HREF` for the on-trace-constant key lookup.
 -- See also https://github.com/LuaJIT/LuaJIT/pull/356.
-local test = tap.test('lj-356-ir-khash-non-string-obj')
+local test = tap.test('lj-356-ir-khash-non-string-obj'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 local N_ITERATIONS = 4
 
 -- Amount of iteration for trace compilation and execution and
 -- additional check, that there is no new trace compiled.
 test:plan(N_ITERATIONS + 1)
 
+local traceinfo = require('jit.util').traceinfo
+local table_new = require('table.new')
+
 -- To reproduce the issue we need to compile a trace with
 -- `IR_HREF`, with a lookup of constant hash key GC value. To
 -- prevent an `IR_HREFK` to be emitted instead, we need a table
diff --git a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
index 8af9143a..d7e9c85e 100644
--- a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
+++ b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-
 -- Test file to demonstrate the incorrect JIT behaviour for HREFK
 -- IR compilation on arm64.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/357.
-local test = tap.test('lj-357-arm64-hrefk')
+local test = tap.test('lj-357-arm64-hrefk'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(2)
 
 jit.opt.start('hotloop=1', 'hotexit=1')
diff --git a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
index 7c8df948..f600d898 100644
--- a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
+++ b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('lj-375-ir-bufput-signed-char'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-375-ir-bufput-signed-char')
 -- XXX: Number of loop iterations.
 -- 1 -- instruction becomes hot
 -- 2, 3 -- trace is recorded (considering loop recording
diff --git a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
index a8235e93..bdd0aaaa 100644
--- a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
+++ b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
@@ -1,18 +1,19 @@
-local ffi = require('ffi')
 local tap = require('tap')
-
 -- Test file to demonstrate the incorrect JIT recording for
 -- `tonumber()` function with cdata argument for failed
 -- conversions.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/408,
 -- https://github.com/LuaJIT/LuaJIT/pull/412,
 -- https://github.com/tarantool/tarantool/issues/7655.
-local test = tap.test('lj-408-tonumber-cdata-record')
-
-local NULL = ffi.cast('void *', 0)
+local test = tap.test('lj-408-tonumber-cdata-record'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
 test:plan(4)
 
+local ffi = require('ffi')
+local NULL = ffi.cast('void *', 0)
+
 local function check(x)
   -- Don't use a tail call to avoid "leaving loop in root trace"
   -- error, so the trace will be compiled.
diff --git a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
index f9a2a869..861114e8 100644
--- a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
+++ b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
@@ -1,7 +1,8 @@
-local ffi = require('ffi')
 local tap = require('tap')
+local test = tap.test('lj-416-xor-before-jcc'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-416-xor-before-jcc')
 test:plan(1)
 
 -- To reproduce this issue, we need:
@@ -30,6 +31,7 @@ test:plan(1)
 -- ucomisd and the jnb, thereby causing the jnb to do the wrong
 -- thing.
 
+local ffi = require('ffi')
 ffi.cdef[[
   int test_xor_func(int a, int b, int c, int d, int e, int f, void * g, int h);
 ]]
diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua
index 633ab676..531acd7d 100644
--- a/test/tarantool-tests/lj-430-maxirconst.test.lua
+++ b/test/tarantool-tests/lj-430-maxirconst.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('lj-430-maxirconst'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
index 2866fb12..fec08b30 100644
--- a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
+++ b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test("lj-505-fold-icorrect-behavior"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test("lj-505-fold-icorrect-behavior")
 test:plan(1)
 
 -- Test file to demonstrate Lua fold machinery icorrect behavior, details:
diff --git a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
index cd0f0f04..b2ccae63 100644
--- a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
+++ b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-local ffi = require('ffi')
+local test = tap.test("or-524-fold-icorrect-behavior"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test("or-524-fold-icorrect-behavior")
 test:plan(1)
 
+local ffi = require('ffi')
 -- Test file to demonstrate LuaJIT folding machinery incorrect behaviour,
 -- details:
 --     https://github.com/LuaJIT/LuaJIT/issues/524
diff --git a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
index 6015f55f..b94bd3e9 100644
--- a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
+++ b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('lj-556-fix-loop-realignment'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-556-fix-loop-realignment')
 test:plan(1)
 
 -- Test file to demonstrate JIT misbehaviour for loop realignment
diff --git a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
index f037c898..e0c3e577 100644
--- a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
+++ b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('lj-584-bad-renames-for-sunk-values'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-584-bad-renames-for-sunk-values')
 test:plan(1)
 
 -- Test file to demonstrate LuaJIT assembler misbehaviour.
diff --git a/test/tarantool-tests/lj-603-err-snap-restore.test.lua b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
index c67da00e..28aaf7f5 100644
--- a/test/tarantool-tests/lj-603-err-snap-restore.test.lua
+++ b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
@@ -3,6 +3,7 @@ local tap = require('tap')
 -- is raised on restoration from the snapshot.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/603.
 local test = tap.test('lj-603-err-snap-restore'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
   -- XXX: The different amount of stack slots is in-use for
   -- Tarantool at start, so just skip test for it.
diff --git a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
index 2165afe3..1d6b19ba 100644
--- a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
+++ b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('lj-672-cdata-allocation-recording'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
index d74c3c2b..d41e33ff 100644
--- a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
+++ b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
@@ -1,10 +1,12 @@
 local tap = require('tap')
-
 -- Test file to demonstrate LuaJIT misbehaviour during recording
 -- BC_VARG with nvarargs >= nresults in GC64 mode.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/864,
 -- https://github.com/tarantool/tarantool/issues/7172.
-local test = tap.test('lj-864-varg-rec-base-offset')
+local test = tap.test('lj-864-varg-rec-base-offset'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 jit.opt.start('hotloop=1')
diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua
index 60a0ccbd..e157622a 100644
--- a/test/tarantool-tests/lj-flush-on-trace.test.lua
+++ b/test/tarantool-tests/lj-flush-on-trace.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('lj-flush-on-trace'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
index a41a1c7a..c8879f57 100644
--- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua
+++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test("clib-misc-getmetrics"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
index e5ee7902..b1f86cea 100644
--- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
+++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
@@ -4,6 +4,7 @@
 
 local tap = require('tap')
 local test = tap.test("lib-misc-getmetrics"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
index accb1ee1..e2701c13 100644
--- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
+++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
@@ -1,8 +1,6 @@
 -- XXX: This comment is a reminder to reimplement memprof tests
 -- assertions to make them more indepentent to the changes made.
--- Now I just leave this 5 lines comment to preserve line numbers.
--- TODO: This line will be removed in the next patch.
--- TODO: This line will be removed in the next patch.
+-- Now I just leave this 3 lines comment to preserve line numbers.
 local tap = require("tap")
 local test = tap.test("misc-memprof-lapi"):skipcond({
   ["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
@@ -18,8 +16,10 @@ local jit_opt_default = {
     "minstitch=0",
 }
 
-jit.off()
-jit.flush()
+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
+-- thrown when LuaJIT is compiled with JIT engine disabled.
+pcall(jit.off)
+pcall(jit.flush)
 
 local table_new = require "table.new"
 
@@ -263,16 +263,14 @@ test:test("symtab-enrich-str", function(subtest)
   )
 end)
 
--- Test profiler with enabled JIT.
-jit.on()
-
 test:test("jit-output", function(subtest)
-  -- Disabled on *BSD due to #4819.
-  if jit.os == 'BSD' then
-    subtest:plan(1)
-    subtest:skip('Disabled due to #4819')
-    return
-  end
+  subtest:skipcond({
+    ['Test requires JIT enabled'] = not jit.status(),
+    ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
+  })
+
+  -- Test profiler with enabled JIT.
+  jit.on()
 
   subtest:plan(4)
 
diff --git a/test/tarantool-tests/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
index 8dc36592..dcde81b9 100644
--- a/test/tarantool-tests/misclib-sysprof-lapi.test.lua
+++ b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
@@ -6,8 +6,10 @@ local test = tap.test("misc-sysprof-lapi"):skipcond({
 
 test:plan(19)
 
-jit.off()
-jit.flush()
+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
+-- thrown when LuaJIT is compiled with JIT engine disabled.
+pcall(jit.off)
+pcall(jit.flush)
 
 local bufread = require("utils.bufread")
 local symtab = require("utils.symtab")
@@ -125,5 +127,4 @@ check_mode("C", 100)
 
 os.remove(TMP_BINFILE)
 
-jit.on()
 os.exit(test:check() and 0 or 1)
-- 
2.30.2


  parent reply	other threads:[~2023-02-13 17:06 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 ` Igor Munkin via Tarantool-patches [this message]
2023-02-14 13:50   ` [Tarantool-patches] [PATCH luajit 5/7] test: add skipcond for all JIT-related tests 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
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=f8bde7cd2e4cf39951db5536df5cc981d99b6e5f.1676304797.git.imun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 5/7] test: add skipcond for all 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