diff --git a/test/app-tap/cfg.test.lua b/test/app-tap/cfg.test.lua index 14e040f9fc9ae71dc22516c986e27a0d1e47ad75..ad3e46520d4c4c4d6ff4f89b58fa3d814ef20ffc 100755 --- a/test/app-tap/cfg.test.lua +++ b/test/app-tap/cfg.test.lua @@ -39,5 +39,4 @@ box.cfg{read_only=true} while f_ro:status() ~= "dead" do fiber.sleep(0.01) end test:is(f_ro:status(), "dead", "entered read-only mode") -test:check() -os.exit(0) +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/console.test.lua b/test/app-tap/console.test.lua index 2fe853a69583269e5878587d6562f2b42ffc25c1..748014ade66f24df56b75b5ad56470d8ff511e6d 100755 --- a/test/app-tap/console.test.lua +++ b/test/app-tap/console.test.lua @@ -341,6 +341,4 @@ triggers_ran = nil os.remove(CONSOLE_SOCKET) os.remove(IPROTO_SOCKET) -test:check() - -os.exit(0) +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/csv.test.lua b/test/app-tap/csv.test.lua index eb180f95da105f9551968f8d1483bf8e4a042423..7d2161efc6acb5b0acf7e463b243c8f6e3fccd88 100755 --- a/test/app-tap/csv.test.lua +++ b/test/app-tap/csv.test.lua @@ -133,4 +133,4 @@ local res = csv.load('929,N1XDN ,,"Enfield, CT",') local exp = {{'929', 'N1XDN', '', 'Enfield, CT', ''}} test:is_deeply(res, exp, 'gh-3489') -test:check() +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/errno.test.lua b/test/app-tap/errno.test.lua index 5fd8eaca4a33424e1ca91b0e3a971f05caef693a..58006bdbdee07e5e384ec79c51c0ebea6e97c52d 100755 --- a/test/app-tap/errno.test.lua +++ b/test/app-tap/errno.test.lua @@ -19,3 +19,5 @@ test:test("primary", function(test) test:is(errno.strerror(), "Invalid argument", "checking strerror without argument") test:is(errno.strerror(errno.EBADF), "Bad file descriptor", "checking strerror with argument") end) + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/fail_main.test.lua b/test/app-tap/fail_main.test.lua index cf6b1d8ed410ab9e70b962aaffc472015066fecd..8cf928a8c2d22db96090fa0eb10cc96043638b87 100755 --- a/test/app-tap/fail_main.test.lua +++ b/test/app-tap/fail_main.test.lua @@ -35,5 +35,4 @@ local _, output = run_script("error('Error in the main script')") test:ok(output:match("fatal error, exiting the event loop"), "main script error is handled gracefully") -test:check() -os.exit(0) +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/func.test.lua b/test/app-tap/func.test.lua index 11bc01f1df60423c577389ec3bc9de131c7ee6f9..e34cd6c8ba1a48a1b11637aea174a8a7030f347c 100755 --- a/test/app-tap/func.test.lua +++ b/test/app-tap/func.test.lua @@ -12,3 +12,5 @@ test:ok(not pcall(box.internal.module_reload, ''), 'expected error: no module') test:ok(not pcall(box.internal.module_reload, 'xxx'), 'expected error: no module') + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/info.test.lua b/test/app-tap/info.test.lua index b4c17356e22eda659d2c919906a32784eb6796c8..301722ed4e1ad0d64fc5a6f7bc404df6ab3f9594 100755 --- a/test/app-tap/info.test.lua +++ b/test/app-tap/info.test.lua @@ -1,8 +1,11 @@ #!/usr/bin/env tarantool local tarantool = require('tarantool') +local test = require('tap').test("info") -require('tap').test("info", function(test) +test:plan(1) + +test:test("info", function(test) test:plan(10) test:like(tarantool.version, '^[1-9]', "version") test:isstring(tarantool.package, "package") @@ -17,3 +20,5 @@ require('tap').test("info", function(test) test:ok(tarantool.uptime() > 0, "uptime") test:ok(tarantool.pid() > 0, "pid") end) + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/json.test.lua b/test/app-tap/json.test.lua index 8f863d2bba09e8a44eb6cabc422caac66b53d99d..7a967513cc20e56a2ef7f116c2172a8e368577a3 100755 --- a/test/app-tap/json.test.lua +++ b/test/app-tap/json.test.lua @@ -19,7 +19,11 @@ local function test_misc(test, s) test:ok(s.NULL == nil, '.NULL == nil') end -tap.test("json", function(test) +local test = tap.test("json") + +test:plan(1) + +test:test("json", function(test) local serializer = require('json') test:plan(58) @@ -214,3 +218,5 @@ tap.test("json", function(test) local t_dec = serializer.decode(bigjson) test:is_deeply(t_dec, t, 'encode/decode big strings') end) + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/logmod.test.lua b/test/app-tap/logmod.test.lua index 270e217188784f3f37c359f5100e25f2e47c3882..6eab77f7e65bea417c0f5178045349826783182f 100755 --- a/test/app-tap/logmod.test.lua +++ b/test/app-tap/logmod.test.lua @@ -32,5 +32,4 @@ test:ok(err == nil and log.cfg.level == 6, 'got verbose') _, err = pcall(log.cfg, {level='debug'}) test:ok(err == nil and log.cfg.level == 7, 'got debug') -test:check() -os.exit() +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/minimal.test.lua b/test/app-tap/minimal.test.lua index e44a0f6a74b6b8b995117caa42fd9cc5aabbb732..14ccec90c2a0b4f4cc5fd9d11837256c8b4591f0 100755 --- a/test/app-tap/minimal.test.lua +++ b/test/app-tap/minimal.test.lua @@ -65,4 +65,4 @@ for _, env in ipairs({ end end -tap:check() +os.exit(tap:check() and 0 or 1) diff --git a/test/app-tap/msgpack.test.lua b/test/app-tap/msgpack.test.lua index 11efbb38b3b4cad066d6c1d0413ddb953f6e6072..f0b199b69385df5e69c4938901ef5480e8c81608 100755 --- a/test/app-tap/msgpack.test.lua +++ b/test/app-tap/msgpack.test.lua @@ -263,7 +263,11 @@ local function test_decode_array_map_header(test, s) end end -tap.test("msgpack", function(test) +local test = tap.test("msgpack") + +test:plan(1) + +test:test("msgpack", function(test) local serializer = require('msgpack') test:plan(15) test:test("unsigned", common.test_unsigned, serializer) @@ -282,3 +286,5 @@ tap.test("msgpack", function(test) test:test("decode_buffer", common.test_decode_buffer, serializer) test:test("error", common.test_error, serializer) end) + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/msgpackffi.test.lua b/test/app-tap/msgpackffi.test.lua index 46ff23e6501190f09368c9d78eeeca55148bfcd7..32e3be8667a0666f9fd54e20c098555aea84305c 100755 --- a/test/app-tap/msgpackffi.test.lua +++ b/test/app-tap/msgpackffi.test.lua @@ -115,7 +115,10 @@ local function test_other(test, s) encode_max_depth = max_depth}) end -tap.test("msgpackffi", function(test) +local test = tap.test("msgpackffi") + +test:plan(1) +test:test("msgpackffi", function(test) local serializer = require('msgpackffi') test:plan(14) test:test("unsigned", common.test_unsigned, serializer) @@ -135,3 +138,5 @@ tap.test("msgpackffi", function(test) test:test("decode_buffer", common.test_decode_buffer, serializer) test:test("error", common.test_error, serializer) end) + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/snapshot.test.lua b/test/app-tap/snapshot.test.lua index 2475ee4b954ac5f54af1fb3260c812675b5298ad..5403b3251ed74f3954c1113b9a45e3d22f2b4a71 100755 --- a/test/app-tap/snapshot.test.lua +++ b/test/app-tap/snapshot.test.lua @@ -148,5 +148,4 @@ test:ok(fio.stat(files[#files]) ~= nil, "Snapshot was recreated") box.space.test:drop() -test:check() -os.exit(0) +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/uri.test.lua b/test/app-tap/uri.test.lua index 3961e3be6a2d5e6276d5f8c9427d745d4643a053..18b37d132337af2b81ea6b9cd7b4ea4ae449eb83 100755 --- a/test/app-tap/uri.test.lua +++ b/test/app-tap/uri.test.lua @@ -748,7 +748,10 @@ local function test_parse_invalid_uri_set_from_lua_table(test) test:is(tostring(error), expected_errmsg, "error message") end -tap.test("uri", function(test) +local test = tap.test("uri") + +test:plan(1) +test:test("uri", function(test) test:plan(6) test:test("parse", test_parse) test:test("parse URI query params", test_parse_uri_query_params) @@ -757,3 +760,5 @@ tap.test("uri", function(test) test:test("parse invalid URIs from lua table", test_parse_invalid_uri_set_from_lua_table) test:test("format", test_format) end) + +os.exit(test:check() and 0 or 1) diff --git a/test/app-tap/yaml.test.lua b/test/app-tap/yaml.test.lua index 8a5e4b233b70952aa12393b7542cf34a16c9f1c0..5c08ef541552cd2af916fc8589e182f93e4949b7 100755 --- a/test/app-tap/yaml.test.lua +++ b/test/app-tap/yaml.test.lua @@ -213,7 +213,10 @@ local function test_api(test, s) end end -tap.test("yaml", function(test) +local test = tap.test("yaml") + +test:plan(1) +test:test("yaml", function(test) local serializer = require('yaml') test:plan(12) test:test("unsigned", common.test_unsigned, serializer) @@ -229,3 +232,5 @@ tap.test("yaml", function(test) test:test("tagged", test_tagged, serializer) test:test("api", test_api, serializer) end) + +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/cfg.test.lua b/test/box-tap/cfg.test.lua index 8f21c5628a784ea6618dccc4662bd3cb6aae072d..c790ba66787cf21951aab09e5ace8e3d25315500 100755 --- a/test/box-tap/cfg.test.lua +++ b/test/box-tap/cfg.test.lua @@ -606,5 +606,4 @@ test:ok(not box.info.listen:match(':0'), 'real port in info.listen') box.cfg{listen = box.NULL} test:is(nil, box.info.listen, 'cfg.listen reset drops info.listen') -test:check() -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/cfgup.test.lua b/test/box-tap/cfgup.test.lua index e699e304f4802a661599824ef7f43093b2e7c493..22d6a130b5e61bdb4b4aa63d364855dcbaf10b76 100755 --- a/test/box-tap/cfgup.test.lua +++ b/test/box-tap/cfgup.test.lua @@ -26,6 +26,4 @@ test:ok(not status and result:match("Can't set option 'pid_file' dynamically"), 'attempt to change immutable key (pid_file)') -test:check() -os.exit(0) - +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/feedback_daemon.test.lua b/test/box-tap/feedback_daemon.test.lua index dbdfe509bd06d5dc0770018b6d482e61f7e8f856..6e8f8464ad977553bd64c6829d1ba0b64eeac6c7 100755 --- a/test/box-tap/feedback_daemon.test.lua +++ b/test/box-tap/feedback_daemon.test.lua @@ -314,5 +314,4 @@ events_expected = { test:is_deeply(actual.events, events_expected, "Events are counted correctly") -test:check() -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/gc.test.lua b/test/box-tap/gc.test.lua index ced87547e066ca36208db8c7846cb1990926a879..bddc540b01ae0b5782b56d8b4276365e4c63332c 100755 --- a/test/box-tap/gc.test.lua +++ b/test/box-tap/gc.test.lua @@ -28,6 +28,4 @@ if debug then box.error.injection.set("ERRINJ_SNAP_COMMIT_DELAY", false) end -test:check() - -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/gh-5750-feedback-disabled-err.test.lua b/test/box-tap/gh-5750-feedback-disabled-err.test.lua index 190e93b7ddbdc6cf4358403ee049a0d7b07d5b92..f84ac1a5c92207a509a081cadfdab696209e83f5 100755 --- a/test/box-tap/gh-5750-feedback-disabled-err.test.lua +++ b/test/box-tap/gh-5750-feedback-disabled-err.test.lua @@ -25,5 +25,4 @@ ok = pcall(box.schema.space.create, 'test') test:ok(ok, 'space create succeeds') ok = pcall(box.space.test.drop, box.space.test) test:ok(ok, 'space drop succeeds') -test:check() -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/net.box.test.lua b/test/box-tap/net.box.test.lua index a46f28ad0d753085271f948a1b1060b034847230..26c5ba3cd339dfc223f43d36788748741ba78fa7 100755 --- a/test/box-tap/net.box.test.lua +++ b/test/box-tap/net.box.test.lua @@ -30,5 +30,4 @@ test:ok(not pcall(function() conn.space._vspace:insert() end), "error handling") -- cleanup conn:close() inspector:cmd('stop server second with cleanup=1') -test:check() -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/on_schema_init.test.lua b/test/box-tap/on_schema_init.test.lua index db9ae6f2769177f9e97d4f3ee05662d089ec917a..4a4d57b55087bb3047f6d80d0d3415a2c803ccce 100755 --- a/test/box-tap/on_schema_init.test.lua +++ b/test/box-tap/on_schema_init.test.lua @@ -26,6 +26,5 @@ str = '' box.schema.space.create("test") -- test that _space.on_replace trigger may be set in on_schema_init test:like(str, '_space:on_replace', 'can set on_replace') -test:check() box.space.test:drop() -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/schema_mt.test.lua b/test/box-tap/schema_mt.test.lua index c0fe5f10b6e3fba46b09d9ad0ff03f6f1d525e18..d7fa4bb217fd9a80d426b2f46d5066b0331be914 100755 --- a/test/box-tap/schema_mt.test.lua +++ b/test/box-tap/schema_mt.test.lua @@ -101,6 +101,4 @@ sp1:drop() sp2:drop() sp3:drop() -test:check() - -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/box-tap/session.storage.test.lua b/test/box-tap/session.storage.test.lua index d17d3efceff7eb40bef5338b4a9d1509a95dabb2..772d31604886f294f70d54a9194ba84dd9fbe8fd 100755 --- a/test/box-tap/session.storage.test.lua +++ b/test/box-tap/session.storage.test.lua @@ -57,4 +57,4 @@ test:is(tres1[1], "cde", "check after closing") test:is(#tres2, 0, "check after closing") conn3:close() inspector:cmd('stop server session_storage with cleanup=1') -os.exit(0) +os.exit(test:check() == true and 0 or 1) diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua index fedaa88bcde3adccd1ca34a578ecfa5fc7810b4b..a9188bf528610f84e4af9f11eb95e336a716e892 100644 --- a/test/sql-tap/lua/sqltester.lua +++ b/test/sql-tap/lua/sqltester.lua @@ -26,8 +26,7 @@ local function flatten(arr) end local function finish_test() - test:check() - os.exit() + os.exit(test:check() and 0 or 1) end test.finish_test = finish_test