Skip to content

Commit 1251d67

Browse files
ligurioBuristan
authored andcommitted
test: skip sysprof tests with LUAJIT_DISABLE_SYSPROF
LuaJIT has a macro LUAJIT_DISABLE_SYSPROF that disables sysprof support. Sysprof tests don't respect this macro, and therefore some of them failed when the macro is enabled. The proposed patch: - Skips sysprof testcases in a suite tarantool-c-tests. - Introduces an environment variable LUAJIT_DISABLE_SYSPROF in a suite tarantool-tests that is set to 1 when sysprof support is disabled. - Propagates a status of sysprof support to Lua tests and skip testing when sysprof is disabled.
1 parent b17e196 commit 1251d67

8 files changed

+17
-0
lines changed

test/tarantool-c-tests/gh-8594-sysprof-ffunc-crash.test.c

+4
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,12 @@ static int test_tostring_call(void *ctx)
277277

278278
int main(void)
279279
{
280+
#if LUAJIT_DISABLE_SYSPROF
281+
return skip_all("Sysprof is disabled");
282+
#else /* LUAJIT_DISABLE_SYSPROF */
280283
const struct test_unit tgroup[] = {
281284
test_unit_def(test_tostring_call),
282285
};
283286
return test_run_group(tgroup, NULL);
287+
#endif /* LUAJIT_DISABLE_SYSPROF */
284288
}

test/tarantool-c-tests/misclib-sysprof-capi.test.c

+4
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ static int profile_func_jiton(void *test_state)
301301

302302
int main(void)
303303
{
304+
#if LUAJIT_DISABLE_SYSPROF
305+
return skip_all("Sysprof is disabled");
306+
#else /* LUAJIT_DISABLE_SYSPROF */
304307
if (LUAJIT_OS != LUAJIT_OS_LINUX)
305308
return skip_all("Sysprof is implemented for Linux only");
306309
if (LUAJIT_TARGET != LUAJIT_ARCH_X86
@@ -322,4 +325,5 @@ int main(void)
322325
const int test_result = test_run_group(tgroup, L);
323326
utils_lua_close(L);
324327
return test_result;
328+
#endif /* LUAJIT_DISABLE_SYSPROF */
325329
}

test/tarantool-tests/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ if(LUAJIT_ENABLE_TABLE_BUMP)
8989
list(APPEND LUA_TEST_ENV_MORE LUAJIT_TABLE_BUMP=1)
9090
endif()
9191

92+
if(LUAJIT_DISABLE_SYSPROF)
93+
list(APPEND LUA_TEST_ENV_MORE LUAJIT_DISABLE_SYSPROF=1)
94+
endif()
95+
9296
set(TEST_SUITE_NAME "tarantool-tests")
9397

9498
# XXX: The call produces both test and target

test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local test = tap.test('gh-5688-tool-cli-flag'):skipcond({
77
['No profile tools CLI option integration'] = _TARANTOOL,
88
-- See also https://github.com/LuaJIT/LuaJIT/issues/606.
99
['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
10+
['Sysprof is disabled'] = os.getenv('LUAJIT_DISABLE_SYSPROF'),
1011
})
1112

1213
test:plan(3)

test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local test = tap.test("gh-5813-resolving-of-c-symbols"):skipcond({
55
["Memprof is implemented for Linux only"] = jit.os ~= "Linux",
66
-- See also https://github.com/LuaJIT/LuaJIT/issues/606.
77
["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
8+
["Sysprof is disabled"] = os.getenv("LUAJIT_DISABLE_SYSPROF")
89
})
910

1011
test:plan(5)

test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ local test = tap.test('gh-7264-add-proto-trace-sysprof-default'):skipcond({
66
['Sysprof is implemented for Linux only'] = jit.os ~= 'Linux',
77
-- See also https://github.com/LuaJIT/LuaJIT/issues/606.
88
['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
9+
['Sysprof is disabled'] = os.getenv('LUAJIT_DISABLE_SYSPROF'),
910
})
1011

1112
test:plan(2)

test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local test = tap.test('gh-9217-profile-parsers-error-handling'):skipcond({
77
['No profile tools CLI option integration'] = _TARANTOOL,
88
-- See also https://github.com/LuaJIT/LuaJIT/issues/606.
99
['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
10+
['Sysprof is disabled'] = os.getenv('LUAJIT_DISABLE_SYSPROF'),
1011
})
1112

1213
jit.off()

test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local test = tap.test("misc-sysprof-lapi"):skipcond({
55
["Sysprof is implemented for Linux only"] = jit.os ~= "Linux",
66
-- See also https://github.com/LuaJIT/LuaJIT/issues/606.
77
["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
8+
["Sysprof is disabled"] = os.getenv('LUAJIT_DISABLE_SYSPROF'),
89
})
910

1011
test:plan(19)

0 commit comments

Comments
 (0)