Repository: tarantool/tarantool
Pull request #11004: cmake: support TAP tests by CTest
Author: login: ligurio
Labels: name: full-ci
description: Enables all tests for a pull request
Created: 2024-12-26T12:39:52Z | Merged: 2025-03-17T17:47:59Z

- [x] Depends on https://github.com/tarantool/tarantool/pull/11021


Diff:
diff --git a/.gitignore b/.gitignore
index e4c77b8772f8..8677226ee588 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,7 @@ perf/output/
 test/Makefile
 test/*/Makefile
 test/*/*/Makefile
+test/*/*-workdir-*
 Doxyfile.API
 RPM
 *.src.rpm
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 60bdef262c23..85deb7a6ce0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ find_program(LD ld)
 find_program(CTAGS ctags)
 find_program(LUACHECK luacheck ENV PATH)
 find_program(PYTHON python)
+find_program(RM rm)
 
 include (CTest)
 enable_testing()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 24cede894d6f..0ede38176c78 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -51,6 +51,7 @@ list(APPEND CTEST_FAIL_REGEXP
 
 string(RANDOM LENGTH 9 ALPHABET 0123456789 RANDOM_SEED)
 message(STATUS "Random seed is ${RANDOM_SEED}")
+set(TEST_PARAM_DELIM ":")
 
 list(APPEND LUATEST_COMMAND_WITH_FLAGS
     ${PROJECT_SOURCE_DIR}/test-run/lib/luatest/bin/luatest
@@ -79,6 +80,7 @@ add_subdirectory(box-tap)
 add_subdirectory(box-luatest)
 add_subdirectory(config-luatest)
 add_subdirectory(engine-luatest)
+add_subdirectory(engine-tap)
 add_subdirectory(metrics-luatest)
 add_subdirectory(replication-luatest)
 add_subdirectory(sql-tap)
@@ -166,12 +168,16 @@ add_custom_target(test-force-ctest
 
 list(APPEND EXECUTED_WITHOUT_TEST_RUN
     app-luatest
+    app-tap
     box-luatest
+    box-tap
     config-luatest
     engine-luatest
+    engine-tap
     metrics-luatest
     replication-luatest
     sql-luatest
+    sql-tap
     vinyl-luatest
 )
 
diff --git a/test/app-tap/CMakeLists.txt b/test/app-tap/CMakeLists.txt
index 0d91a7c0d85a..9a8a5aceaf1b 100644
--- a/test/app-tap/CMakeLists.txt
+++ b/test/app-tap/CMakeLists.txt
@@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(TEST_TITLE "test/${TEST_SUITE_NAME}/${test_name}")
+  set(WORK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${WORK_DIR})
+  set(TEST_CMD "${RM} -rf ${WORK_DIR}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${TEST_TITLE}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${WORK_DIR}
+  )
+  set(TEST_ENV_VARS "")
+  if(NOT ${TEST_TITLE} STREQUAL test/app-tap/logger.test.lua)
+    list(APPEND TEST_ENV_VARS TT_WORK_DIR=${WORK_DIR})
+  endif()
+  set_tests_properties(${TEST_TITLE} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS}"
+    LABELS "${TEST_SUITE_NAME};regression"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/app-tap/suite.ini.
+if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+  set_tests_properties(
+    test/app-tap/gh-2717-no-quit-sigint.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
+
+# See console.skipcond, disabled on FreeBSD due to fail #4271.
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+  set_tests_properties(
+    test/app-tap/console.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
+
+# See fail_main.skipcond and popen.skipcond, disabled on OpenBSD.
+if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+  set_tests_properties(
+    test/app-tap/fail_main.test.lua
+    test/app-tap/popen.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
diff --git a/test/app-tap/console.test.lua b/test/app-tap/console.test.lua
index 748014ade66f..cfd526bfa204 100755
--- a/test/app-tap/console.test.lua
+++ b/test/app-tap/console.test.lua
@@ -11,10 +11,9 @@ local _
 
 -- Suppress console log messages
 log.level(4)
-local CONSOLE_SOCKET = fio.pathjoin(fio.cwd(), 'tarantool-test-console.sock')
-local IPROTO_SOCKET = fio.pathjoin(fio.cwd(), 'tarantool-test-iproto.sock')
-os.remove(CONSOLE_SOCKET)
-os.remove(IPROTO_SOCKET)
+local TMPDIR = fio.tempdir()
+local CONSOLE_SOCKET = fio.pathjoin(TMPDIR, 'tarantool-test-console.sock')
+local IPROTO_SOCKET = fio.pathjoin(TMPDIR, 'tarantool-test-iproto.sock')
 
 --
 local EOL = "\n...\n"
@@ -340,5 +339,6 @@ session_id = nil
 triggers_ran = nil
 os.remove(CONSOLE_SOCKET)
 os.remove(IPROTO_SOCKET)
+fio.rmdir(TMPDIR)
 
 os.exit(test:check() and 0 or 1)
diff --git a/test/app-tap/gh-2717-no-quit-sigint.test.lua b/test/app-tap/gh-2717-no-quit-sigint.test.lua
index 8eef3e95bd71..cfc73d2871c9 100755
--- a/test/app-tap/gh-2717-no-quit-sigint.test.lua
+++ b/test/app-tap/gh-2717-no-quit-sigint.test.lua
@@ -136,7 +136,8 @@ local log_file = fio.abspath('tarantool.log')
 local pid_file = fio.abspath('tarantool.pid')
 local xlog_file = fio.abspath('00000000000000000000.xlog')
 local snap_file = fio.abspath('00000000000000000000.snap')
-local sock = fio.abspath('tarantool.soc')
+local tmpdir = fio.tempdir()
+local sock = fio.pathjoin(tmpdir, 'tarantool.soc')
 
 local user_grant = ' box.schema.user.grant(\'guest\', \'super\')'
 local arg = ' -e \"box.cfg{pid_file=\''
@@ -272,4 +273,6 @@ test:unlike(ph:info().status.state, popen.state.EXITED,
 ph:shutdown({stdin = true})
 ph:close()
 
+fio.rmdir(tmpdir)
+
 os.exit(test:check() and 0 or 1)
diff --git a/test/box-tap/CMakeLists.txt b/test/box-tap/CMakeLists.txt
index 6f0311d7ffe2..e81e474f7f73 100644
--- a/test/box-tap/CMakeLists.txt
+++ b/test/box-tap/CMakeLists.txt
@@ -1 +1,74 @@
 build_module(check_merge_source check_merge_source.c)
+
+set(TEST_SUITE_NAME "box-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+# XXX: The call produces both test and target <box-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS check_merge_source
+)
+
+list(APPEND TEST_ENV
+  "BUILDDIR=${PROJECT_BINARY_DIR}"
+  "LUA_PATH=${LUA_PATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(TEST_TITLE "test/${TEST_SUITE_NAME}/${test_name}")
+  set(WORK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${WORK_DIR})
+  set(TEST_CMD "${RM} -rf ${WORK_DIR}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${TEST_TITLE}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  # `LISTEN` is required by the following tests:
+  # - test/box-tap/auth.test.lua
+  # - test/box-tap/extended_error.test.lua
+  set(TEST_ENV_VARS "${TEST_ENV};LISTEN=${WORK_DIR}/listen.sock;")
+  # The tests below could be broken by setting environment
+  # variable `TT_WORK_DIR`, so `TT_WORK_DIR` is not set.
+  if(NOT ${TEST_TITLE} STREQUAL test/box-tap/cfg.test.lua AND
+     NOT ${TEST_TITLE} STREQUAL test/box-tap/gh-4562-errno-at-xdir_scan.test.lua)
+    set(TEST_ENV_VARS ${TEST_ENV_VARS};TT_WORK_DIR=${WORK_DIR};)
+  endif()
+  set_tests_properties(${TEST_TITLE} PROPERTIES
+    ENVIRONMENT "${TEST_ENV_VARS}"
+    LABELS "${TEST_SUITE_NAME};regression"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+  set_tests_properties(
+    # See test/box-tap/suite.ini.
+    test/box-tap/errinj_set_with_enviroment_vars.test.lua
+    test/box-tap/gh-6198-max-cnt-of-tuple-fields-insert-overflow-err-msg.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
+
+# See cfg.skipcond, disabled on OpenBSD.
+if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+  set_tests_properties(
+    test/box-tap/cfg.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
diff --git a/test/box-tap/suite.cfg b/test/box-tap/suite.cfg
deleted file mode 100644
index 91a721d47318..000000000000
--- a/test/box-tap/suite.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-    "gh-4231-box-execute-locking.test.lua": {
-        "box_load_and_execute": {"conf": "box_load_and_execute"},
-        "box.execute": {"conf": "box.execute"}
-    }
-}
diff --git a/test/box-tap/suite.ini b/test/box-tap/suite.ini
index b6329b5162a1..df8590e7e61e 100644
--- a/test/box-tap/suite.ini
+++ b/test/box-tap/suite.ini
@@ -4,15 +4,11 @@ description = Database tests with #! using TAP
 is_parallel = True
 use_unix_sockets_iproto = True
 release_disabled = errinj_set_with_enviroment_vars.test.lua gh-6198-max-cnt-of-tuple-fields-insert-overflow-err-msg.test.lua
-config = suite.cfg
 fragile = {
     "retries": 10,
     "tests": {
         "cfg.test.lua": {
             "issues": [ "gh-4344" ]
-        },
-        "gh-4231-box-execute-locking.test.lua": {
-            "issues": [ "gh-5558" ]
         }
     }
   }
diff --git a/test/engine-tap/CMakeLists.txt b/test/engine-tap/CMakeLists.txt
new file mode 100644
index 000000000000..7d811021962f
--- /dev/null
+++ b/test/engine-tap/CMakeLists.txt
@@ -0,0 +1,58 @@
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lib/?.lua
+)
+
+set(TEST_SUITE_NAME "engine-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <engine-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(TEST_TITLE "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(WORK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${WORK_DIR})
+  set(TEST_CMD "${RM} -rf ${WORK_DIR}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${TEST_TITLE}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${TEST_TITLE} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${WORK_DIR};TEST_ENGINE=memtx"
+    LABELS "${TEST_SUITE_NAME};regression"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(TEST_TITLE "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(WORK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${WORK_DIR})
+  set(TEST_CMD "${RM} -rf ${WORK_DIR}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${TEST_TITLE}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${TEST_TITLE} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${WORK_DIR};TEST_ENGINE=vinyl;"
+    LABELS "${TEST_SUITE_NAME};regression"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
diff --git a/test/engine-tap/lib/tester.lua b/test/engine-tap/lib/tester.lua
index bc540b857f02..2594b56a2795 100644
--- a/test/engine-tap/lib/tester.lua
+++ b/test/engine-tap/lib/tester.lua
@@ -10,7 +10,12 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+-- Default value `memtx` was added to have ability to run a
+-- `engine-tap` test w/o `test-run.py`, see commit
+-- commit 3bd870261c462416c29226414fe0a2d79aba0c74
+-- ('box, datetime: datetime comparison for indices').
+local engine = test_run and test_run:get_cfg('engine') or
+               (os.getenv('TEST_ENGINE') or 'memtx')
 
 function test.engine(self)
     return engine
diff --git a/test/fuzz/lua/CMakeLists.txt b/test/fuzz/lua/CMakeLists.txt
index 59abe41f6087..27123e2bf957 100644
--- a/test/fuzz/lua/CMakeLists.txt
+++ b/test/fuzz/lua/CMakeLists.txt
@@ -18,14 +18,14 @@ list(APPEND TEST_ENGINE_FLAGS
   --seed ${RANDOM_SEED}
   --verbose
 )
-add_test(NAME ${test_path}/test_engine.lua-memtx
+add_test(NAME ${test_path}/test_engine.lua${TEST_PARAM_DELIM}memtx
   COMMAND ${TARANTOOL_BIN}
           ${CMAKE_CURRENT_SOURCE_DIR}/test_engine.lua
           ${TEST_ENGINE_FLAGS}
           --test_dir ${CMAKE_CURRENT_BINARY_DIR}/test_engine-memtx
           --engine memtx
 )
-add_test(NAME ${test_path}/test_engine.lua-vinyl
+add_test(NAME ${test_path}/test_engine.lua${TEST_PARAM_DELIM}vinyl
   COMMAND ${TARANTOOL_BIN}
           ${CMAKE_CURRENT_SOURCE_DIR}/test_engine.lua
           ${TEST_ENGINE_FLAGS}
@@ -33,8 +33,8 @@ add_test(NAME ${test_path}/test_engine.lua-vinyl
           --engine vinyl
 )
 set_tests_properties(
-  ${test_path}/test_engine.lua-vinyl
-  ${test_path}/test_engine.lua-memtx
+  ${test_path}/test_engine.lua${TEST_PARAM_DELIM}vinyl
+  ${test_path}/test_engine.lua${TEST_PARAM_DELIM}memtx
   PROPERTIES
     ENVIRONMENT "LUA_PATH=${LUA_PATH}"
     LABELS "${TEST_SUITE_NAME};fuzzing;"
diff --git a/test/sql-tap/CMakeLists.txt b/test/sql-tap/CMakeLists.txt
index 136a517d4574..7d1e8621afcd 100644
--- a/test/sql-tap/CMakeLists.txt
+++ b/test/sql-tap/CMakeLists.txt
@@ -9,3 +9,110 @@ build_module(sql_uuid sql_uuid.c)
 target_link_libraries(sql_uuid msgpuck core)
 build_module(decimal decimal.c)
 target_link_libraries(decimal msgpuck)
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    ${PROJECT_SOURCE_DIR}/test/sql/lua/?.lua
+    # Needed for identifier.lua.
+    ${PROJECT_SOURCE_DIR}/test/box/lua/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "sql-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <sql-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS gh-5938-wrong-string-length
+          gh-6024-funcs-return-bin
+          gh-2579-custom-aggregate
+          sql_uuid decimal
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+  "BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(TEST_TITLE "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(WORK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${WORK_DIR})
+  set(TEST_CMD "${RM} -rf ${WORK_DIR}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${TEST_TITLE}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${TEST_TITLE} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${WORK_DIR};TEST_ENGINE=memtx;"
+    LABELS "${TEST_SUITE_NAME};regression"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(TEST_TITLE "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(WORK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${WORK_DIR})
+  set(TEST_CMD "${RM} -rf ${WORK_DIR}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${TEST_TITLE}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${TEST_TITLE} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${WORK_DIR};TEST_ENGINE=vinyl;"
+    LABELS "${TEST_SUITE_NAME};regression"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
+list(APPEND DISABLED_TESTS
+  test/sql-tap/analyze1.test.lua
+  test/sql-tap/analyze3.test.lua
+  test/sql-tap/analyze4.test.lua
+  test/sql-tap/analyze5.test.lua
+  test/sql-tap/analyze6.test.lua
+  test/sql-tap/analyze7.test.lua
+  test/sql-tap/analyze8.test.lua
+  test/sql-tap/analyze9.test.lua
+  test/sql-tap/analyzeC.test.lua
+  test/sql-tap/analyzeD.test.lua
+  test/sql-tap/analyzeE.test.lua
+  test/sql-tap/analyzeF.test.lua
+  test/sql-tap/date.test.lua
+  # See gh-3694.
+  test/sql-tap/debug_mode_only.test.lua
+  test/sql-tap/e_expr.test.lua
+  test/sql-tap/gh-3350-skip-scan.test.lua
+  test/sql-tap/like2.test.lua
+  test/sql-tap/randexpr1.test.lua
+  test/sql-tap/selectA.test.lua
+  test/sql-tap/tkt3791.test.lua
+  test/sql-tap/tkt-bd484a090c.test.lua
+  test/sql-tap/types2.test.lua
+)
+foreach(test_name IN LISTS DISABLED_TESTS)
+  set_tests_properties(
+    ${test_name}${TEST_PARAM_DELIM}memtx
+    ${test_name}${TEST_PARAM_DELIM}vinyl
+    PROPERTIES DISABLED TRUE
+  )
+endforeach()
diff --git a/test/sql-tap/engine.cfg b/test/sql-tap/engine.cfg
index 528212ab6e90..0007d8d7a80e 100644
--- a/test/sql-tap/engine.cfg
+++ b/test/sql-tap/engine.cfg
@@ -1,46 +1,4 @@
 {
-    "analyze9.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "collation_unicode.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "in2.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "delete3.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "sort.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "gh-3083-ephemeral-unref-tuples.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "gh-3332-tuple-format-leak.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "gh-6164-uuid-follow-ups.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "metatypes.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "decimal.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "gh-6239-quote-with-double-arg.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "built-in-functions.test.lua": {
-        "memtx": {"engine": "memtx"}
-    },
-    "gh-6157-unnecessary-free-on-string.test.lua": {},
-    "gh-6376-wrong-double-to-dec-cmp.test.lua": {},
-    "gh-4077-iproto-execute-no-bind.test.lua": {},
-    "gh-6375-assert-on-unsupported-ext.test.lua": {},
-    "gh-6485-bugs-in-decimal.test.lua": {},
-    "gh-6113-assert-in-hex-on-zeroblob.test.lua": {},
     "*": {
         "memtx": {"engine": "memtx"},
         "vinyl": {"engine": "vinyl"}
diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua
index 9aa64fdefa89..ed787a13550c 100644
--- a/test/sql-tap/lua/sqltester.lua
+++ b/test/sql-tap/lua/sqltester.lua
@@ -426,7 +426,12 @@ box.cfg{
 
 -- A lot of tests from sql-tap are very long and not designed to be limited
 require('fiber').set_max_slice(100500)
-local engine = test_run and test_run:get_cfg('engine') or 'memtx'
+-- Default value `memtx` was added to have ability to run a
+-- `sql-tap` test w/o `test-run.py`, see commit
+-- 84cb1e049272e20c8ad33c883c0f1d6fa0930698
+-- ('sql: increase time quota for selectG test on vinyl').
+local engine = test_run and test_run:get_cfg('engine') or
+               (os.getenv('TEST_ENGINE') or 'memtx')
 box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.space._session_settings:update('sql_seq_scan', {{'=', 2, true}})
 


Reviews:
user: login: Buristan
body: Hi, Sergey!
Thanks for the patch-set and decent work regarding this activity!
Very appreciate the fact that we may run tests much more simply.
I'll proceed with the review per-patch below.

---

**[PATCH 1/4] test: remove suite.cfg in box-tap**

LGTM!

---

**[PATCH 2/4] test: update parameters in sql-tap tests**

LGTM, with a minor nits regarding the commit message.

> Long time ago (as Mergen Imeev told) API for Tarantool's storage

Typo: s/Long/A long/
Typo: s/told)/told),/

> engines was not unified and SQL tests can be successfully executed

Typo: s/unified/unified,/
Typo: s/can/could/

> on one engine and be broken on other. Due to this, some SQL tests

Typo: s/other/another/

---

**[PATCH 3/4] cmake: define test parameter delimiter**

LGTM.

---

**[PATCH 4/4] cmake: support TAP tests by CTest**

Generally LGTM, but see several suggestions and comments below.

> Note, that TAP test suites uses environment variable

Typo: s/uses/use
Typo: s/environment/the environment/

> `MEMTX_ALLOCATOR`. Support from test executor is not required for

Typo: s/test executor/the test executor/

> files, in parallel corrupts generated Lua files.

Typo: s/files,/files/
Typo: s/generated/the generated/

I saw that we have very similar prologues and epilogues for each of the TAP/luatest suites:
Prologue:
```
  get_filename_component(test_name ${test_path} NAME)
  # FIXME: By default, GLOB lists directories.
  # Directories are omitted in the result if LIST_DIRECTORIES
  # is set to false. New in version CMake 3.3.
  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
    continue()
  endif()
  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
```

Epilogue:
```
  set_tests_properties(${test_title} PROPERTIES
    ENVIRONMENT "${TEST_ENV}"
    LABELS "${TEST_SUITE_NAME};regression;"
    DEPENDS ${TEST_SUITE_NAME}-deps
    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
  )
```

Maybe we can somehow use a macro for these parts to avoid copy-pasting with errors (see the comment below `integration` vs `regression` label).

Also, the bodies of the test setup are similar across the suites (i.e., for all luatest/for all TAP suites).
And the same note is about setup for different engines. The setup is literally the same except for the engine name.

What do you think about this macro approach?
Feel free to ignore, though.

Also, I've got tons of SQL test failed runs from the root project dir like the following:
```
$ ctest -V -R test/sql-tap/alter2.test.lua:memtx
...
1442: Got     : [1,"Failed to create foreign key constraint 'fk2': referenced space doesn't feature PRIMARY KEY"]
```

state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-03-04T14:55:57Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T09:44:27Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T09:47:17Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T15:18:27Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T15:36:53Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T17:27:57Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T17:32:08Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T17:35:19Z
user: login: Buristan
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-05T17:44:07Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T17:44:20Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T17:56:41Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-05T17:57:16Z
user: login: Buristan
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T10:05:23Z
user: login: Buristan
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T10:05:31Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T10:58:58Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T11:36:51Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T12:27:17Z
user: login: Buristan
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T15:39:30Z
user: login: Buristan
state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T15:48:16Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T16:40:08Z
user: login: ligurio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-07T08:43:29Z
user: login: Buristan
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-17T14:05:36Z
user: login: Buristan
body: Sergey,
Thanks for the fixes!
LGTM!
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-17T17:47:47Z

Review comments:
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
path: test/app-tap/CMakeLists.txt
user: login: Buristan
body: 
Please add a comment what auto-generated file should be placed in those directories.


created_at: 2025-03-04T14:48:38Z
author_association: COLLABORATOR
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
path: test/app-tap/CMakeLists.txt
user: login: Buristan
body: 
Q: Should it be also `${work_dir}` for the consistency?
Here and below.


created_at: 2025-03-04T14:48:42Z
author_association: COLLABORATOR
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set(TEST_ENV_VARS "")
+  if(NOT ${test_title} STREQUAL test/app-tap/logger.test.lua)
+    list(APPEND TEST_ENV_VARS TT_WORK_DIR=${work_dir})
+  endif()
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS};"
+    LABELS "${TEST_SUITE_NAME};integration"
path: test/app-tap/CMakeLists.txt
user: login: Buristan
body: 
Looks like a typo: should it be `regression`, like in all luatest suites and etc.?
Here and below.


created_at: 2025-03-04T14:49:14Z
author_association: COLLABORATOR
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set(TEST_ENV_VARS "")
+  if(NOT ${test_title} STREQUAL test/app-tap/logger.test.lua)
+    list(APPEND TEST_ENV_VARS TT_WORK_DIR=${work_dir})
+  endif()
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS};"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/app-tap/suite.ini.
+if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+  set_tests_properties(
+    test/app-tap/gh-2717-no-quit-sigint.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
+
+# See console.skipcond, disabled on FreeBSD due to fail #4271.
+if(UNIX AND NOT APPLE)
+  set_tests_properties(
+    test/app-tap/console.test.lua
path: test/app-tap/CMakeLists.txt
user: login: Buristan
body: 
This condition disables it for Linux too, I've got the following message locally:
```
 The following tests did not run:
         795 - test/app-tap/console.test.lua (Disabled)
```

created_at: 2025-03-04T14:49:58Z
author_association: COLLABORATOR
diff_hunk: @@ -1 +1,72 @@
 build_module(check_merge_source check_merge_source.c)
+
+set(TEST_SUITE_NAME "box-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+# XXX: The call produces both test and target <box-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS check_merge_source
+)
+
+list(APPEND TEST_ENV
+  "BUILDDIR=${PROJECT_BINARY_DIR}"
+  "LUA_PATH=${LUA_PATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  # `LISTEN` is required by the following tests:
+  # - test/box-tap/auth.test.lua
+  # - test/box-tap/extended_error.test.lua
+  set(TEST_ENV_VARS "${TEST_ENV};LISTEN=${work_dir}/listen.sock;")
+  if(NOT ${test_title} STREQUAL test/box-tap/cfg.test.lua AND
path: test/box-tap/CMakeLists.txt
user: login: Buristan
body: 
Q: Why do we avoid the `TT_WORK_DIR` for these tests?
Please add the comment.


created_at: 2025-03-04T14:50:22Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,58 @@
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lib/?.lua
+)
+
+set(TEST_SUITE_NAME "engine-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <engine-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
path: test/engine-tap/CMakeLists.txt
user: login: Buristan
body: 
Why do we have `;` at the end here but not for the memtx setup?
created_at: 2025-03-04T14:51:21Z
author_association: COLLABORATOR
diff_hunk: @@ -10,7 +10,9 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run ~= nil and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/engine-tap/lib/tester.lua
user: login: Buristan
body: 
I suppose this should be `os.getenv('TEST_ENGINE') or 'memtx'` to remain the compatibility with test_run.


created_at: 2025-03-04T14:51:46Z
author_association: COLLABORATOR
diff_hunk: @@ -10,7 +10,9 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run ~= nil and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
+engine = engine:gsub('"', '')
path: test/engine-tap/lib/tester.lua
user: login: Buristan
body: Why do we need this line? Looks like CMake misconfiguration.

created_at: 2025-03-04T14:51:57Z
author_association: COLLABORATOR
diff_hunk: @@ -9,3 +9,124 @@ build_module(sql_uuid sql_uuid.c)
 target_link_libraries(sql_uuid msgpuck core)
 build_module(decimal decimal.c)
 target_link_libraries(decimal msgpuck)
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    ${PROJECT_SOURCE_DIR}/test/sql/lua/?.lua
+    # Needed for identifier.lua.
+    ${PROJECT_SOURCE_DIR}/test/box/lua/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "sql-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <sql-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS gh-5938-wrong-string-length
+          gh-6024-funcs-return-bin
+          gh-2579-custom-aggregate
+          sql_uuid decimal
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+  "BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
+string(JOIN ";" DISABLED_TESTS
path: test/sql-tap/CMakeLists.txt
user: login: Buristan
body: Minor: Why don't use `list(APPEND` instead?

created_at: 2025-03-04T14:53:00Z
author_association: COLLABORATOR
diff_hunk: @@ -9,3 +9,124 @@ build_module(sql_uuid sql_uuid.c)
 target_link_libraries(sql_uuid msgpuck core)
 build_module(decimal decimal.c)
 target_link_libraries(decimal msgpuck)
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    ${PROJECT_SOURCE_DIR}/test/sql/lua/?.lua
+    # Needed for identifier.lua.
+    ${PROJECT_SOURCE_DIR}/test/box/lua/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "sql-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <sql-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS gh-5938-wrong-string-length
+          gh-6024-funcs-return-bin
+          gh-2579-custom-aggregate
+          sql_uuid decimal
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+  "BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
+string(JOIN ";" DISABLED_TESTS
+  test/sql-tap/analyze1.test.lua
+  test/sql-tap/analyze3.test.lua
+  test/sql-tap/analyze4.test.lua
+  test/sql-tap/analyze5.test.lua
+  test/sql-tap/analyze6.test.lua
+  test/sql-tap/analyze7.test.lua
+  test/sql-tap/analyze8.test.lua
+  test/sql-tap/analyze9.test.lua
+  test/sql-tap/analyzeC.test.lua
+  test/sql-tap/analyzeD.test.lua
+  test/sql-tap/analyzeE.test.lua
+  test/sql-tap/analyzeF.test.lua
+  test/sql-tap/date.test.lua
+  # See gh-3694.
+  test/sql-tap/debug_mode_only.test.lua
+  test/sql-tap/e_expr.test.lua
+  test/sql-tap/gh-3350-skip-scan.test.lua
+  test/sql-tap/like2.test.lua
+  test/sql-tap/randexpr1.test.lua
+  test/sql-tap/selectA.test.lua
+  test/sql-tap/tkt3791.test.lua
+  test/sql-tap/tkt-bd484a090c.test.lua
+  test/sql-tap/types2.test.lua
+)
+foreach(test_name IN LISTS DISABLED_TESTS)
+  set_tests_properties(
+    ${test_name}${TEST_PARAM_DELIM}memtx
+    ${test_name}${TEST_PARAM_DELIM}vinyl
+    PROPERTIES DISABLED TRUE
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
path: test/sql-tap/CMakeLists.txt
user: login: Buristan
body: 
Since #11043 is landed, should the part below be deleted?


created_at: 2025-03-04T14:53:58Z
author_association: COLLABORATOR
diff_hunk: @@ -426,7 +426,8 @@ box.cfg{
 
 -- A lot of tests from sql-tap are very long and not designed to be limited
 require('fiber').set_max_slice(100500)
-local engine = test_run and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/sql-tap/lua/sqltester.lua
user: login: Buristan
body: 
I suppose this should be `os.getenv('TEST_ENGINE') or 'memtx'` to remain the compatibility with test_run.

created_at: 2025-03-04T14:55:16Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,58 @@
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lib/?.lua
+)
+
+set(TEST_SUITE_NAME "engine-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <engine-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
path: test/engine-tap/CMakeLists.txt
user: login: ligurio
body: It was excess, removed.

```diff
--- a/test/app-tap/CMakeLists.txt
+++ b/test/app-tap/CMakeLists.txt
@@ -58,7 +58,7 @@ foreach(test_path ${tests})
     list(APPEND TEST_ENV_VARS TT_WORK_DIR=${work_dir})
   endif()
   set_tests_properties(${test_title} PROPERTIES
-    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS};"
+    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS}"
     LABELS "${TEST_SUITE_NAME};integration"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
```
created_at: 2025-03-05T09:44:27Z
author_association: MEMBER
diff_hunk: @@ -9,3 +9,124 @@ build_module(sql_uuid sql_uuid.c)
 target_link_libraries(sql_uuid msgpuck core)
 build_module(decimal decimal.c)
 target_link_libraries(decimal msgpuck)
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    ${PROJECT_SOURCE_DIR}/test/sql/lua/?.lua
+    # Needed for identifier.lua.
+    ${PROJECT_SOURCE_DIR}/test/box/lua/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "sql-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <sql-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS gh-5938-wrong-string-length
+          gh-6024-funcs-return-bin
+          gh-2579-custom-aggregate
+          sql_uuid decimal
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+  "BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
+string(JOIN ";" DISABLED_TESTS
path: test/sql-tap/CMakeLists.txt
user: login: ligurio
body: Fixed:

```diff
--- a/test/sql-tap/CMakeLists.txt
+++ b/test/sql-tap/CMakeLists.txt
@@ -84,7 +84,7 @@ foreach(test_path ${tests})
 endforeach()
 
 # See test/sql-tap/suite.ini.
-string(JOIN ";" DISABLED_TESTS
+list(APPEND DISABLED_TESTS
   test/sql-tap/analyze1.test.lua
   test/sql-tap/analyze3.test.lua
   test/sql-tap/analyze4.test.lua
```
created_at: 2025-03-05T09:47:16Z
author_association: MEMBER
diff_hunk: @@ -9,3 +9,124 @@ build_module(sql_uuid sql_uuid.c)
 target_link_libraries(sql_uuid msgpuck core)
 build_module(decimal decimal.c)
 target_link_libraries(decimal msgpuck)
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    ${PROJECT_SOURCE_DIR}/test/sql/lua/?.lua
+    # Needed for identifier.lua.
+    ${PROJECT_SOURCE_DIR}/test/box/lua/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "sql-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <sql-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS gh-5938-wrong-string-length
+          gh-6024-funcs-return-bin
+          gh-2579-custom-aggregate
+          sql_uuid decimal
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+  "BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}memtx")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-memtx")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}${TEST_PARAM_DELIM}vinyl")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir-vinyl")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${TAP_TEST_FLAGS} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
+string(JOIN ";" DISABLED_TESTS
+  test/sql-tap/analyze1.test.lua
+  test/sql-tap/analyze3.test.lua
+  test/sql-tap/analyze4.test.lua
+  test/sql-tap/analyze5.test.lua
+  test/sql-tap/analyze6.test.lua
+  test/sql-tap/analyze7.test.lua
+  test/sql-tap/analyze8.test.lua
+  test/sql-tap/analyze9.test.lua
+  test/sql-tap/analyzeC.test.lua
+  test/sql-tap/analyzeD.test.lua
+  test/sql-tap/analyzeE.test.lua
+  test/sql-tap/analyzeF.test.lua
+  test/sql-tap/date.test.lua
+  # See gh-3694.
+  test/sql-tap/debug_mode_only.test.lua
+  test/sql-tap/e_expr.test.lua
+  test/sql-tap/gh-3350-skip-scan.test.lua
+  test/sql-tap/like2.test.lua
+  test/sql-tap/randexpr1.test.lua
+  test/sql-tap/selectA.test.lua
+  test/sql-tap/tkt3791.test.lua
+  test/sql-tap/tkt-bd484a090c.test.lua
+  test/sql-tap/types2.test.lua
+)
+foreach(test_name IN LISTS DISABLED_TESTS)
+  set_tests_properties(
+    ${test_name}${TEST_PARAM_DELIM}memtx
+    ${test_name}${TEST_PARAM_DELIM}vinyl
+    PROPERTIES DISABLED TRUE
+  )
+endforeach()
+
+# See test/sql-tap/suite.ini.
path: test/sql-tap/CMakeLists.txt
user: login: ligurio
body: Many thanks!

```diff
@@ -116,17 +116,3 @@ foreach(test_name IN LISTS DISABLED_TESTS)
     PROPERTIES DISABLED TRUE
   )
 endforeach()
-
-# See test/sql-tap/suite.ini.
-string(JOIN ";" LONG_TESTS
-  test/sql-tap/gh-3332-tuple-format-leak.test.lua
-  test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua
-)
-foreach(test_name IN LISTS LONG_TESTS)
-  set_tests_properties(
-    ${test_name}${TEST_PARAM_DELIM}memtx
-    ${test_name}${TEST_PARAM_DELIM}vinyl
-    PROPERTIES
-      LABELS "long"
-  )
-endforeach()
```
created_at: 2025-03-05T15:18:27Z
author_association: MEMBER
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set(TEST_ENV_VARS "")
+  if(NOT ${test_title} STREQUAL test/app-tap/logger.test.lua)
+    list(APPEND TEST_ENV_VARS TT_WORK_DIR=${work_dir})
+  endif()
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS};"
+    LABELS "${TEST_SUITE_NAME};integration"
path: test/app-tap/CMakeLists.txt
user: login: ligurio
body: ```
[1] ~/sources/MRG/tarantool $ find test/*-tap -name CMakeLists.txt |xargs grep LABELS
test/app-tap/CMakeLists.txt:  LABELS ${TEST_SUITE_NAME}
test/app-tap/CMakeLists.txt:    LABELS "${TEST_SUITE_NAME};integration"
test/box-tap/CMakeLists.txt:  LABELS ${TEST_SUITE_NAME}
test/box-tap/CMakeLists.txt:    LABELS "${TEST_SUITE_NAME};integration"
test/engine-tap/CMakeLists.txt:  LABELS ${TEST_SUITE_NAME}
test/engine-tap/CMakeLists.txt:    LABELS "${TEST_SUITE_NAME};integration"
test/engine-tap/CMakeLists.txt:    LABELS "${TEST_SUITE_NAME};integration"
test/sql-tap/CMakeLists.txt:  LABELS ${TEST_SUITE_NAME}
test/sql-tap/CMakeLists.txt:    LABELS "${TEST_SUITE_NAME};integration"
test/sql-tap/CMakeLists.txt:    LABELS "${TEST_SUITE_NAME};integration"
```

Right, fixed:

```diff
diff --git a/test/app-tap/CMakeLists.txt b/test/app-tap/CMakeLists.txt
index c214136903..837c2b1194 100644
--- a/test/app-tap/CMakeLists.txt
+++ b/test/app-tap/CMakeLists.txt
@@ -59,7 +59,7 @@ foreach(test_path ${tests})
   endif()
   set_tests_properties(${test_title} PROPERTIES
     ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS}"
-    LABELS "${TEST_SUITE_NAME};integration"
+    LABELS "${TEST_SUITE_NAME};regression"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
   )
diff --git a/test/box-tap/CMakeLists.txt b/test/box-tap/CMakeLists.txt
index d42a9e202a..f9808401ef 100644
--- a/test/box-tap/CMakeLists.txt
+++ b/test/box-tap/CMakeLists.txt
@@ -48,7 +48,7 @@ foreach(test_path ${tests})
   endif()
   set_tests_properties(${test_title} PROPERTIES
     ENVIRONMENT "${TEST_ENV_VARS}"
-    LABELS "${TEST_SUITE_NAME};integration"
+    LABELS "${TEST_SUITE_NAME};regression"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
   )
diff --git a/test/engine-tap/CMakeLists.txt b/test/engine-tap/CMakeLists.txt
index e85fa03ce3..33cd702eb6 100644
--- a/test/engine-tap/CMakeLists.txt
+++ b/test/engine-tap/CMakeLists.txt
@@ -36,7 +36,7 @@ foreach(test_path ${tests})
   )
   set_tests_properties(${test_title} PROPERTIES
     ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx"
-    LABELS "${TEST_SUITE_NAME};integration"
+    LABELS "${TEST_SUITE_NAME};regression"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
   )
@@ -51,7 +51,7 @@ foreach(test_path ${tests})
   )
   set_tests_properties(${test_title} PROPERTIES
     ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
-    LABELS "${TEST_SUITE_NAME};integration"
+    LABELS "${TEST_SUITE_NAME};regression"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
   )
diff --git a/test/sql-tap/CMakeLists.txt b/test/sql-tap/CMakeLists.txt
index a31689653f..5d1dc1878f 100644
--- a/test/sql-tap/CMakeLists.txt
+++ b/test/sql-tap/CMakeLists.txt
@@ -62,7 +62,7 @@ foreach(test_path ${tests})
   )
   set_tests_properties(${test_title} PROPERTIES
     ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=memtx;"
-    LABELS "${TEST_SUITE_NAME};integration"
+    LABELS "${TEST_SUITE_NAME};regression"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
   )
@@ -77,7 +77,7 @@ foreach(test_path ${tests})
   )
   set_tests_properties(${test_title} PROPERTIES
     ENVIRONMENT "${TEST_ENV};TT_WORK_DIR=${work_dir};TEST_ENGINE=vinyl;"
-    LABELS "${TEST_SUITE_NAME};integration"
+    LABELS "${TEST_SUITE_NAME};regression"
     DEPENDS ${TEST_SUITE_NAME}-deps
     FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
   )
```
created_at: 2025-03-05T15:36:52Z
author_association: MEMBER
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  set(TEST_ENV_VARS "")
+  if(NOT ${test_title} STREQUAL test/app-tap/logger.test.lua)
+    list(APPEND TEST_ENV_VARS TT_WORK_DIR=${work_dir})
+  endif()
+  set_tests_properties(${test_title} PROPERTIES
+    ENVIRONMENT "${TEST_ENV};${TEST_ENV_VARS};"
+    LABELS "${TEST_SUITE_NAME};integration"
+    DEPENDS ${TEST_SUITE_NAME}-deps
+    FAIL_REGULAR_EXPRESSION "${CTEST_FAIL_REGEXP}"
+  )
+endforeach()
+
+# See test/app-tap/suite.ini.
+if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+  set_tests_properties(
+    test/app-tap/gh-2717-no-quit-sigint.test.lua
+    PROPERTIES DISABLED TRUE
+  )
+endif()
+
+# See console.skipcond, disabled on FreeBSD due to fail #4271.
+if(UNIX AND NOT APPLE)
+  set_tests_properties(
+    test/app-tap/console.test.lua
path: test/app-tap/CMakeLists.txt
user: login: ligurio
body: Replaced with condition with `CMAKE_SYSTEM_NAME` [^1].

```diff
--- a/test/app-tap/CMakeLists.txt
+++ b/test/app-tap/CMakeLists.txt
@@ -74,7 +74,7 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
 endif()
 
 # See console.skipcond, disabled on FreeBSD due to fail #4271.
-if(UNIX AND NOT APPLE)
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
   set_tests_properties(
     test/app-tap/console.test.lua
     PROPERTIES DISABLED TRUE
```

[^1]: https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html
created_at: 2025-03-05T17:27:57Z
author_association: MEMBER
diff_hunk: @@ -1 +1,72 @@
 build_module(check_merge_source check_merge_source.c)
+
+set(TEST_SUITE_NAME "box-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+# XXX: The call produces both test and target <box-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS check_merge_source
+)
+
+list(APPEND TEST_ENV
+  "BUILDDIR=${PROJECT_BINARY_DIR}"
+  "LUA_PATH=${LUA_PATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  )
+  # `LISTEN` is required by the following tests:
+  # - test/box-tap/auth.test.lua
+  # - test/box-tap/extended_error.test.lua
+  set(TEST_ENV_VARS "${TEST_ENV};LISTEN=${work_dir}/listen.sock;")
+  if(NOT ${test_title} STREQUAL test/box-tap/cfg.test.lua AND
path: test/box-tap/CMakeLists.txt
user: login: ligurio
body: Added:

```diff
--- a/test/box-tap/CMakeLists.txt
+++ b/test/box-tap/CMakeLists.txt
@@ -42,6 +42,8 @@ foreach(test_path ${tests})
   # - test/box-tap/auth.test.lua
   # - test/box-tap/extended_error.test.lua
   set(TEST_ENV_VARS "${TEST_ENV};LISTEN=${work_dir}/listen.sock;")
+  # The tests below could be broken by setting environment
+  # variable `TT_WORK_DIR`, so `TT_WORK_DIR` is not set.
   if(NOT ${test_title} STREQUAL test/box-tap/cfg.test.lua AND
      NOT ${test_title} STREQUAL test/box-tap/gh-4562-errno-at-xdir_scan.test.lua)
     set(TEST_ENV_VARS ${TEST_ENV_VARS};TT_WORK_DIR=${work_dir};)
```
created_at: 2025-03-05T17:32:07Z
author_association: MEMBER
diff_hunk: @@ -10,7 +10,9 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run ~= nil and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
+engine = engine:gsub('"', '')
path: test/engine-tap/lib/tester.lua
user: login: ligurio
body: It is not needed actually, removed:

```diff
--- a/test/engine-tap/lib/tester.lua
+++ b/test/engine-tap/lib/tester.lua
@@ -12,7 +12,6 @@ local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
 local engine = test_run ~= nil and test_run:get_cfg('engine') or
                os.getenv('TEST_ENGINE')
-engine = engine:gsub('"', '')
 
 function test.engine(self)
     return engine
```
created_at: 2025-03-05T17:35:19Z
author_association: MEMBER
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
path: test/app-tap/CMakeLists.txt
user: login: Buristan
body: My bad, it's about regular Lua files located in this directories (misread as BINARY directory at first).
created_at: 2025-03-05T17:44:07Z
author_association: COLLABORATOR
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
path: test/app-tap/CMakeLists.txt
user: login: ligurio
body: With `WORKING_DIRECTORY` equal to `${work_dir}` test `test/app-tap/gh-2717-no-quit-sigint.test.lua` is failed with `809: LuajitError: ...G/tarantool/test/app-tap/gh-2717-no-quit-sigint.test.lua:265: time_quota is violated`.
created_at: 2025-03-05T17:44:19Z
author_association: MEMBER
diff_hunk: @@ -10,7 +10,9 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run ~= nil and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/engine-tap/lib/tester.lua
user: login: ligurio
body: Tarantool engine is obtained via `test-run/test_run.lua` if `test_run` variable is not `nil` and when `test_run` is `nil` we use `TEST_ENGINE`. So I don't see anything bad for `test-run`. 

Also, testsuite `engine-tap` is parameterized by both engines for all tests, see:

```
[0] ~/sources/MRG/tarantool/build $ cat ../test/engine-tap/engine.cfg 
{
    "*": {
        "memtx": {"engine": "memtx"},
        "vinyl": {"engine": "vinyl"}
    }
}
```
created_at: 2025-03-05T17:56:41Z
author_association: MEMBER
diff_hunk: @@ -426,7 +426,8 @@ box.cfg{
 
 -- A lot of tests from sql-tap are very long and not designed to be limited
 require('fiber').set_max_slice(100500)
-local engine = test_run and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/sql-tap/lua/sqltester.lua
user: login: ligurio
body: The same as with `engine-tap`:

Tarantool engine is obtained via `test-run/test_run.lua` if `test_run` variable is not `nil` and when `test_run` is `nil` we use `TEST_ENGINE`. So I don't see anything bad for `test-run`. 

Also, testsuite `sql-tap` is parameterized by both engines for all tests, see:

```
[0] ~/sources/MRG/tarantool/build $ cat ../test/sql-tap/engine.cfg 
{
    "*": {
        "memtx": {"engine": "memtx"},
        "vinyl": {"engine": "vinyl"}
    }
}
```
created_at: 2025-03-05T17:57:16Z
author_association: MEMBER
diff_hunk: @@ -10,7 +10,9 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run ~= nil and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/engine-tap/lib/tester.lua
user: login: Buristan
body: Hmm, maybe it is done to be able to run this test stand-alone from the terminal (without set `TEST_ENGINE`).
I suppose it is better to add the deleted fallback case to avoid breaking this scenario of the test launch.
created_at: 2025-03-06T10:05:23Z
author_association: COLLABORATOR
diff_hunk: @@ -426,7 +426,8 @@ box.cfg{
 
 -- A lot of tests from sql-tap are very long and not designed to be limited
 require('fiber').set_max_slice(100500)
-local engine = test_run and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/sql-tap/lua/sqltester.lua
user: login: Buristan
body: Hmm, maybe it is done to be able to run this test stand-alone from the terminal (without set `TEST_ENGINE`).
I suppose it is better to add the deleted fallback case to avoid breaking this scenario of the test launch.
created_at: 2025-03-06T10:05:31Z
author_association: COLLABORATOR
diff_hunk: @@ -426,7 +426,8 @@ box.cfg{
 
 -- A lot of tests from sql-tap are very long and not designed to be limited
 require('fiber').set_max_slice(100500)
-local engine = test_run and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/sql-tap/lua/sqltester.lua
user: login: ligurio
body: Seems so, the default value `memtx` was added by Alexander Turenko in 84cb1e049272e20c8ad33c883c0f1d6fa0930698 without explanation why it is needed:

>  Also enabled ability to run a sql-tap test w/o test-run. It was broken since b09f5964.

```diff
@@ -421,8 +431,11 @@ box.cfg{
     log="tarantool.log";
 }
 
-test_run = require('test_run').new()
-engine = test_run:get_cfg('engine')
+local engine = test_run and test_run:get_cfg('engine') or 'memtx'
 box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
 
+function test.engine(self)
+    return engine
+end
+
 return test
```

Yet another strange requirement, that is not tested in CI, but we must support it...

Added fallback:

```diff
--- a/test/sql-tap/lua/sqltester.lua
+++ b/test/sql-tap/lua/sqltester.lua
@@ -426,8 +426,12 @@ box.cfg{
 
 -- A lot of tests from sql-tap are very long and not designed to be limited
 require('fiber').set_max_slice(100500)
+-- Default value `memtx` was added to have ability to run a
+-- `sql-tap` test w/o `test-run.py`, see commit
+-- 84cb1e049272e20c8ad33c883c0f1d6fa0930698
+-- ('sql: increase time quota for selectG test on vinyl').
 local engine = test_run and test_run:get_cfg('engine') or
-               os.getenv('TEST_ENGINE')
+               (os.getenv('TEST_ENGINE') or 'memtx')
 box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 box.space._session_settings:update('sql_seq_scan', {{'=', 2, true}})
 ```
created_at: 2025-03-06T10:58:58Z
author_association: MEMBER
diff_hunk: @@ -10,7 +10,9 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or 'memtx'
+local engine = test_run ~= nil and test_run:get_cfg('engine') or
+               os.getenv('TEST_ENGINE')
path: test/engine-tap/lib/tester.lua
user: login: ligurio
body: The default value `memtx` was added by Timur Safin in 3bd870261c462416c29226414fe0a2d79aba0c74 when he introduced `engine-tap` test suite.

Added a fallback:

```diff
--- a/test/engine-tap/lib/tester.lua
+++ b/test/engine-tap/lib/tester.lua
@@ -10,8 +10,12 @@ local test = tap.test("errno")
 
 local ok, test_run = pcall(require, 'test_run')
 test_run = ok and test_run.new() or nil
-local engine = test_run ~= nil and test_run:get_cfg('engine') or
-               os.getenv('TEST_ENGINE')
+-- Default value `memtx` was added to have ability to run a
+-- `engine-tap` test w/o `test-run.py`, see commit
+-- commit 3bd870261c462416c29226414fe0a2d79aba0c74
+-- ('box, datetime: datetime comparison for indices').
+local engine = test_run and test_run:get_cfg('engine') or
+               (os.getenv('TEST_ENGINE') or 'memtx')
 
 function test.engine(self)
     return engine
```
created_at: 2025-03-06T11:36:51Z
author_association: MEMBER
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
path: test/app-tap/CMakeLists.txt
user: login: ligurio
body: Fixed:

```diff
--- a/test/app-tap/CMakeLists.txt
+++ b/test/app-tap/CMakeLists.txt
@@ -51,7 +51,7 @@ foreach(test_path ${tests})
   set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
   add_test(NAME ${test_title}
            COMMAND ${BASH} -c "${TEST_CMD}"
-           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+           WORKING_DIRECTORY ${work_dir}
   )
   set(TEST_ENV_VARS "")
   if(NOT ${test_title} STREQUAL test/app-tap/logger.test.lua)
```

Also, added a commit that fixes `test/app-tap/gh-2717-no-quit-sigint.test.lua`: "test: fix a problem with unix socket path".
created_at: 2025-03-06T12:27:17Z
author_association: MEMBER
diff_hunk: @@ -6,3 +6,86 @@ target_link_libraries(module_api msgpuck)
 set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Werror")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+
+tarantool_make_lua_path(LUA_PATH
+  PATHS
+    ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
+    ${CMAKE_CURRENT_SOURCE_DIR}/lua/?.lua
+    # Needed for test-run/test_run.lua.
+    ${PROJECT_SOURCE_DIR}/test-run/?.lua
+)
+
+tarantool_make_lua_path(LUA_CPATH
+  PATHS
+  ${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}
+)
+
+set(TEST_SUITE_NAME "app-tap")
+
+message(STATUS "Add test suite ${TEST_SUITE_NAME}")
+
+# XXX: The call produces both test and target <app-tap-deps>
+# as a side effect.
+_add_test_suite_target(${TEST_SUITE_NAME}
+  LABELS ${TEST_SUITE_NAME}
+  DEPENDS module_api
+)
+
+list(APPEND TEST_ENV
+  "LUA_PATH=${LUA_PATH}"
+  "LUA_CPATH=${LUA_CPATH}"
+)
+
+file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR} *.test.lua)
+foreach(test_path ${tests})
+  get_filename_component(test_name ${test_path} NAME)
+  # FIXME: By default, GLOB lists directories.
+  # Directories are omitted in the result if LIST_DIRECTORIES
+  # is set to false. New in version CMake 3.3.
+  if(${test_name} STREQUAL ${TEST_SUITE_NAME})
+    continue()
+  endif()
+  set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
+  set(work_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-workdir")
+  file(MAKE_DIRECTORY ${work_dir})
+  set(TEST_CMD "${RM} -rf ${work_dir}/* && ${TARANTOOL_BIN} ${test_path}")
+  add_test(NAME ${test_title}
+           COMMAND ${BASH} -c "${TEST_CMD}"
+           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
path: test/app-tap/CMakeLists.txt
user: login: Buristan
body: Nice, thanks!
created_at: 2025-03-06T15:39:30Z
author_association: COLLABORATOR
path: CMakeLists.txt
user: login: Buristan
body: I suppose it would be nice to add the following patch, since tests create tons of helper directories:

```diff
diff --git a/.gitignore b/.gitignore
index e4c77b877..8677226ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,7 @@ perf/output/
 test/Makefile
 test/*/Makefile
 test/*/*/Makefile
+test/*/*-workdir-*
 Doxyfile.API
 RPM
 *.src.rpm
```

Also, we may use a single directory as a root for the tests output in each suite instead.
created_at: 2025-03-06T15:48:07Z
author_association: COLLABORATOR
path: CMakeLists.txt
user: login: ligurio
body: > I suppose it would be nice to add the following patch, since tests create tons of helper directories:

Added.

> Also, we may use a single directory as a root for the tests output in each suite instead.

I'm not sure common dir is needed for workdirs in each suite.
created_at: 2025-03-06T16:40:08Z
author_association: MEMBER
path: CMakeLists.txt
user: login: ligurio
body: Finally added to the last patch and force-pushed.

```
.gitignore
CMakeLists.txt
test/CMakeLists.txt
test/app-tap/CMakeLists.txt
test/box-tap/CMakeLists.txt
test/engine-tap/CMakeLists.txt
test/engine-tap/lib/tester.lua
test/sql-tap/CMakeLists.txt
test/sql-tap/lua/sqltester.lua
```
created_at: 2025-03-07T08:43:29Z
author_association: MEMBER
path: CMakeLists.txt
user: login: Buristan
body: Thanks!
created_at: 2025-03-17T14:05:36Z
author_association: COLLABORATOR

PR comments:
user: login: coveralls
created_at: 2024-12-26T12:56:22Z
body: 
[![Coverage Status](https://coveralls.io/builds/72762241/badge)](https://coveralls.io/builds/72762241)

coverage: 87.447% (-0.02%) from 87.464%
when pulling **b697464758bef61e1e34be772215ff043fe7b128 on ligurio:ligurio/gh-xxxx-ctest-tap-support**
into **eb39f3c4a2c5e25dbc9b279ac3eea75a14d40b13
 on tarantool:master**.

author_association: NONE
user: login: github-advanced-security[bot]
created_at: 2024-12-26T18:18:41Z
body: This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on [this overview](/tarantool/tarantool/security/code-scanning?query=pr%3A11004+is%3Aopen). Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out [the documentation](https://docs.github.com/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning). 
author_association: NONE
user: login: ligurio
created_at: 2025-03-03T12:52:56Z
body: (rebased to the master branch)
author_association: MEMBER
user: login: Buristan
created_at: 2025-03-05T15:36:17Z
body: > Also, I've got tons of SQL test failed runs from the root project dir like the following:

PEBKAC, I have not cleaned the CMake flags related to fuzzing. Ignore this part.
author_association: COLLABORATOR
user: login: ligurio
created_at: 2025-03-17T13:08:42Z
body: > I saw that we have very similar prologues and epilogues for each of the TAP/luatest suites:

Right, the code generated tests is quite similar in test suites. However, I would not replace this code by macro or function because TAP suites have quirks in loops `foreach(test_path ${tests})  ... endforeach()` and folding to macro/function will make such places a bit complicated than before.
`
author_association: MEMBER