From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id E82FE6EC56; Mon, 15 Mar 2021 16:22:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E82FE6EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615814556; bh=vHPYF5SQ5V+eJjCldBWC02oNPq/6b3EfsX8n8rk/X5c=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=h1giqLPj0Q0b5PTDCge0NSeQ67/ho5FdZhKc2iWPMnfRV8IpJZi1fr7b6HbhbFbOK IKdwOMS9S62lzviHf1M/xGLnW/7NtnnF+EI8n8mBmsDE8clZIB6/Vsy2rnfcNWjZUe /BcvTK8cXwQwZDJjzmn5Bp+Qm2zgBAsFneyox0VA= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7CD7D6EC56 for ; Mon, 15 Mar 2021 16:22:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7CD7D6EC56 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lLnB3-0000y0-3a; Mon, 15 Mar 2021 16:22:33 +0300 Date: Mon, 15 Mar 2021 16:22:26 +0300 To: Sergey Kaplun Message-ID: <20210315132226.GB9042@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69BBBF766E27323369B0CCE27335774643500894C459B0CD1B9A248B1BEEC57D8FE1849EDEF42FA8CBA13173DE53030AB58CEBD7663CDD6CE63 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7227E4400968B082FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F63E14183F8C6AF98638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD50EA1E9064FFBDF456B4AF64CA97C28863A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658359CC434672EE6371117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C224915F38A1EB2280F99089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7C0CD47C530221010843847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FA8EF81845B15A4842623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5283D39CAB010B701CF6BA400CACD3A36CA29FCA96C47E1EFD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D347D10A9FCB2A62DFE2A33D2467661EC44C9A23DAACB77E322F191F88C7EE11CD026D06136E68071851D7E09C32AA3244CDD1E080ACE513CFABE8E6E4393E49A70E3D93501275E802F927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmD8gqPF9k0lWmfJ6ncEOcw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822F588E7591428ACBA4FC32193F014442DA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/6] test: adjust lua-Harness test suite for Tarantool X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, Thanks for the patch, though it's almost excess... On 12.03.21, Sergey Kaplun wrote: > This patch makes it possible to run lua-Harness test suite using > Tarantool. > > Tarantool has its own loaded tap built in so need to change name to > another one. You can simply remove Tarantool TAP module from package.loaded in test/luajit-test-init.lua (and move it out of the Debug condition preliminary). See the incremental patches for both LuaJIT and Tarantool repos at the end. > > 203-lexico.t and 301-basic.t is adjusted to valid working with > out-of-source build in Tarantool CI. Your solution works, but it's too specific for our case. Consider the following: one need to run lua-Harness suite outside from its source tree. He faces the same issue, so I believe it's better to tweak the test the next way (the patch is incremental for your branch). ================================================================================ diff --git a/test/lua-Harness-tests/203-lexico.t b/test/lua-Harness-tests/203-lexico.t index be67a440..8ac140b2 100755 --- a/test/lua-Harness-tests/203-lexico.t +++ b/test/lua-Harness-tests/203-lexico.t @@ -117,24 +117,26 @@ do like(msg, "^[^:]+:%d+: unfinished long comment .-near") end --- Adapt tests for testing with Tarantool's out of source build --- on read only file system. CUR_SOURCE_DIR is set via CMake. -local path_to_sources = os.getenv('CUR_SOURCE_DIR') .. '/' +-- XXX: If this test is run out of the tests source tree, the +-- relative paths below become invalid. Hence, we need to prepend +-- the directory from the script (i.e. test) name to the auxiliary +-- files to be loaded and executed. +local cwd = arg[0]:gsub('([^/]+)%.t$', '') if _VERSION >= 'Lua 5.2' or jit then - dofile(path_to_sources .. 'lexico52/lexico.t') + dofile(cwd .. 'lexico52/lexico.t') end if _VERSION >= 'Lua 5.3' or luajit21 then - dofile(path_to_sources .. 'lexico53/lexico.t') + dofile(cwd .. 'lexico53/lexico.t') end if _VERSION >= 'Lua 5.4' then - dofile(path_to_sources .. 'lexico54/lexico.t') + dofile(cwd .. 'lexico54/lexico.t') end if jit and pcall(require, 'ffi') then - dofile(path_to_sources .. 'lexicojit/lexico.t') + dofile(cwd .. 'lexicojit/lexico.t') end done_testing() diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t index 0489c707..55b10ce7 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -843,10 +843,11 @@ do -- xpcall end if jit and pcall(require, 'ffi') then - -- Adapt test for testing with Tarantool's out of source build - -- on read only file system. CUR_SOURCE_DIR is set via CMake. - local path_to_sources = os.getenv('CUR_SOURCE_DIR') - dofile(path_to_sources .. '/lexicojit/basic.t') + -- XXX: If this test is run out of the tests source tree, the + -- relative paths below become invalid. Hence, we need to + -- prepend the directory from the script (i.e. test) name to + -- the auxiliary files to be loaded and executed. + dofile(arg[0]:gsub('([^/]+)%.t$', '') .. 'lexicojit/basic.t') end done_testing() diff --git a/test/lua-Harness-tests/CMakeLists.txt b/test/lua-Harness-tests/CMakeLists.txt index e62f2d12..77ad9c21 100644 --- a/test/lua-Harness-tests/CMakeLists.txt +++ b/test/lua-Harness-tests/CMakeLists.txt @@ -42,9 +42,6 @@ add_custom_command(TARGET lua-Harness-tests # for more info. # So use less preferable way for tests. # See the root CMakeLists.txt for more info. - # XXX: Adapt to run test witht Tarantool on read-only - # file systems with dofile(CUR_SOURCE_DIR..filename). - CUR_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} ${PROVE} ${CMAKE_CURRENT_SOURCE_DIR} --exec '${LUAJIT_TEST_COMMAND} -l profile_luajit21' --ext ${LUA_TEST_SUFFIX} ================================================================================ Tres bien, n'est-ce pas? You can also propose the patch to Francois in lua-Harness repo[1]. > > Also creates additional list of files provided to prove via stdin. > This is required to avoid tests hungs via Tarantool's binary. > Partially this problem is descripted in tarantool/tarantool#5040. I removed the related changes and rebased the branch on the current master with resolved #5040 (considering #5040 fixes the issue for all long-term branches) and CI[2] is green (except the known issues). See the incremental patches for both LuaJIT and Tarantool repos below. > > Part of tarantool/tarantool#5844 > Part of tarantool/tarantool#4473 > --- > Author: Mergen Imeev > > .gitignore | 1 + > test/lua-Harness-tests/090-tap.t | 2 +- > test/lua-Harness-tests/091-profile.t | 2 +- > test/lua-Harness-tests/101-boolean.t | 2 +- > test/lua-Harness-tests/102-function.t | 2 +- > test/lua-Harness-tests/103-nil.t | 2 +- > test/lua-Harness-tests/104-number.t | 2 +- > test/lua-Harness-tests/105-string.t | 2 +- > test/lua-Harness-tests/106-table.t | 2 +- > test/lua-Harness-tests/107-thread.t | 2 +- > test/lua-Harness-tests/108-userdata.t | 2 +- > test/lua-Harness-tests/200-examples.t | 2 +- > test/lua-Harness-tests/201-assign.t | 2 +- > test/lua-Harness-tests/202-expr.t | 2 +- > test/lua-Harness-tests/203-lexico.t | 14 +++++++++----- > test/lua-Harness-tests/204-grammar.t | 2 +- > test/lua-Harness-tests/211-scope.t | 2 +- > test/lua-Harness-tests/212-function.t | 2 +- > test/lua-Harness-tests/213-closure.t | 2 +- > test/lua-Harness-tests/214-coroutine.t | 2 +- > test/lua-Harness-tests/221-table.t | 2 +- > test/lua-Harness-tests/222-constructor.t | 2 +- > test/lua-Harness-tests/223-iterator.t | 2 +- > test/lua-Harness-tests/231-metatable.t | 2 +- > test/lua-Harness-tests/232-object.t | 2 +- > test/lua-Harness-tests/241-standalone.t | 10 +++++----- > test/lua-Harness-tests/242-luac.t | 2 +- > test/lua-Harness-tests/301-basic.t | 7 +++++-- > test/lua-Harness-tests/303-package.t | 6 +++--- > test/lua-Harness-tests/304-string.t | 2 +- > test/lua-Harness-tests/305-utf8.t | 2 +- > test/lua-Harness-tests/306-table.t | 2 +- > test/lua-Harness-tests/307-math.t | 2 +- > test/lua-Harness-tests/308-io.t | 2 +- > test/lua-Harness-tests/309-os.t | 2 +- > test/lua-Harness-tests/310-debug.t | 2 +- > test/lua-Harness-tests/311-bit32.t | 2 +- > test/lua-Harness-tests/314-regex.t | 2 +- > test/lua-Harness-tests/320-stdin.t | 2 +- > test/lua-Harness-tests/401-bitop.t | 2 +- > test/lua-Harness-tests/402-ffi.t | 2 +- > test/lua-Harness-tests/403-jit.t | 2 +- > test/lua-Harness-tests/404-ext.t | 2 +- > test/lua-Harness-tests/411-luajit.t | 2 +- > test/lua-Harness-tests/CMakeLists.txt | 17 +++++++++++++++-- > .../{tap.lua => tap_harness.lua} | 0 > 46 files changed, 77 insertions(+), 56 deletions(-) > rename test/lua-Harness-tests/{tap.lua => tap_harness.lua} (100%) > > diff --git a/test/lua-Harness-tests/241-standalone.t b/test/lua-Harness-tests/241-standalone.t > index c5237ee..33d5159 100755 > --- a/test/lua-Harness-tests/241-standalone.t > +++ b/test/lua-Harness-tests/241-standalone.t > @@ -228,14 +228,14 @@ end > like(f:read'*l', "^usage: ", "no file") > f:close() > > -cmd = lua .. [[ -ltap -e "print(type(ok))"]] > +cmd = lua .. [[ -ltap_harness -e "print(type(ok))"]] Side note: "Unloading" hack works here, since nothing tap-specific is used in this test: it checks only third party module loading and nothing more. BTW, this test is masked in the following patch. > f = io.popen(cmd) > -is(f:read'*l', 'function', "-ltap") > +is(f:read'*l', 'function', "-ltap_harness") > f:close() > > -cmd = lua .. [[ -l tap -e "print(type(ok))"]] > +cmd = lua .. [[ -l tap_harness -e "print(type(ok))"]] > f = io.popen(cmd) > -is(f:read'*l', 'function', "-l tap") > +is(f:read'*l', 'function', "-l tap_harness") > f:close() > > cmd = lua .. [[ -l lpeg -e "print(1)" 2>&1]] > -- > 2.28.0 The incremental patch for LuaJIT reverting the renaming: ================================================================================ diff --git a/.gitignore b/.gitignore index 1fb81bc9..2103a30f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,3 @@ compile_commands.json install_manifest.txt luajit-parse-memprof luajit.pc -tests_list diff --git a/test/lua-Harness-tests/090-tap.t b/test/lua-Harness-tests/090-tap.t index 99932f2e..92f04d8e 100755 --- a/test/lua-Harness-tests/090-tap.t +++ b/test/lua-Harness-tests/090-tap.t @@ -22,7 +22,7 @@ ]] -require'tap_harness' +require'tap' plan(3) ok( true, 'ok' ) diff --git a/test/lua-Harness-tests/091-profile.t b/test/lua-Harness-tests/091-profile.t index ebc142da..db474384 100755 --- a/test/lua-Harness-tests/091-profile.t +++ b/test/lua-Harness-tests/091-profile.t @@ -22,7 +22,7 @@ ]] -require'tap_harness' +require'tap' plan'no_plan' diff --git a/test/lua-Harness-tests/101-boolean.t b/test/lua-Harness-tests/101-boolean.t index 653509f0..0033eff0 100755 --- a/test/lua-Harness-tests/101-boolean.t +++ b/test/lua-Harness-tests/101-boolean.t @@ -22,7 +22,7 @@ ]] -require'tap_harness' +require'tap' local has_op53 = _VERSION >= 'Lua 5.3' plan'no_plan' diff --git a/test/lua-Harness-tests/102-function.t b/test/lua-Harness-tests/102-function.t index cb7e9d05..48ed814e 100755 --- a/test/lua-Harness-tests/102-function.t +++ b/test/lua-Harness-tests/102-function.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local has_op53 = _VERSION >= 'Lua 5.3' plan'no_plan' diff --git a/test/lua-Harness-tests/103-nil.t b/test/lua-Harness-tests/103-nil.t index a74c491f..561b1018 100755 --- a/test/lua-Harness-tests/103-nil.t +++ b/test/lua-Harness-tests/103-nil.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local has_op53 = _VERSION >= 'Lua 5.3' plan'no_plan' diff --git a/test/lua-Harness-tests/104-number.t b/test/lua-Harness-tests/104-number.t index 634d22a0..0d4d3fdb 100755 --- a/test/lua-Harness-tests/104-number.t +++ b/test/lua-Harness-tests/104-number.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local profile = require'profile' local has_op53 = _VERSION >= 'Lua 5.3' diff --git a/test/lua-Harness-tests/105-string.t b/test/lua-Harness-tests/105-string.t index f2ea067f..cd8c88bf 100755 --- a/test/lua-Harness-tests/105-string.t +++ b/test/lua-Harness-tests/105-string.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local profile = require'profile' local has_op53 = _VERSION >= 'Lua 5.3' diff --git a/test/lua-Harness-tests/106-table.t b/test/lua-Harness-tests/106-table.t index 4a66f694..0c0ba49b 100755 --- a/test/lua-Harness-tests/106-table.t +++ b/test/lua-Harness-tests/106-table.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local has_op53 = _VERSION >= 'Lua 5.3' plan'no_plan' diff --git a/test/lua-Harness-tests/107-thread.t b/test/lua-Harness-tests/107-thread.t index e67ef363..3d4af18d 100755 --- a/test/lua-Harness-tests/107-thread.t +++ b/test/lua-Harness-tests/107-thread.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local has_op53 = _VERSION >= 'Lua 5.3' plan'no_plan' diff --git a/test/lua-Harness-tests/108-userdata.t b/test/lua-Harness-tests/108-userdata.t index 687b1b81..b1e3641a 100755 --- a/test/lua-Harness-tests/108-userdata.t +++ b/test/lua-Harness-tests/108-userdata.t @@ -22,7 +22,7 @@ --]] -require'tap_harness' +require'tap' local has_op53 = _VERSION >= 'Lua 5.3' plan'no_plan' diff --git a/test/lua-Harness-tests/200-examples.t b/test/lua-Harness-tests/200-examples.t index cb06a80e..362aae3a 100755 --- a/test/lua-Harness-tests/200-examples.t +++ b/test/lua-Harness-tests/200-examples.t @@ -24,7 +24,7 @@ First tests in order to check infrastructure. --]] -require'tap_harness' +require'tap' plan(5) diff --git a/test/lua-Harness-tests/201-assign.t b/test/lua-Harness-tests/201-assign.t index f7ed4725..7d023d8e 100755 --- a/test/lua-Harness-tests/201-assign.t +++ b/test/lua-Harness-tests/201-assign.t @@ -28,7 +28,7 @@ L --]] -require'tap_harness' +require'tap' local has_env = _VERSION >= 'Lua 5.2' plan'no_plan' diff --git a/test/lua-Harness-tests/202-expr.t b/test/lua-Harness-tests/202-expr.t index f03d5ea3..25767507 100755 --- a/test/lua-Harness-tests/202-expr.t +++ b/test/lua-Harness-tests/202-expr.t @@ -28,7 +28,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local nocvtn2s = profile.nocvtn2s local nocvts2n = profile.nocvts2n diff --git a/test/lua-Harness-tests/203-lexico.t b/test/lua-Harness-tests/203-lexico.t index 0a73f8cf..be67a440 100755 --- a/test/lua-Harness-tests/203-lexico.t +++ b/test/lua-Harness-tests/203-lexico.t @@ -31,7 +31,7 @@ L --]] -require'tap_harness' +require'tap' local loadstring = loadstring or load local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') diff --git a/test/lua-Harness-tests/204-grammar.t b/test/lua-Harness-tests/204-grammar.t index 03580f48..d9ae3a6f 100755 --- a/test/lua-Harness-tests/204-grammar.t +++ b/test/lua-Harness-tests/204-grammar.t @@ -28,7 +28,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local has_goto = _VERSION >= 'Lua 5.2' or jit local has_attr = _VERSION >= 'Lua 5.4' diff --git a/test/lua-Harness-tests/211-scope.t b/test/lua-Harness-tests/211-scope.t index 8e26a6fe..64eed521 100755 --- a/test/lua-Harness-tests/211-scope.t +++ b/test/lua-Harness-tests/211-scope.t @@ -30,7 +30,7 @@ See section "Local Variables and Blocks" in "Programming in Lua". --]] -require'tap_harness' +require'tap' plan(10) diff --git a/test/lua-Harness-tests/212-function.t b/test/lua-Harness-tests/212-function.t index 405035e2..28510537 100755 --- a/test/lua-Harness-tests/212-function.t +++ b/test/lua-Harness-tests/212-function.t @@ -30,7 +30,7 @@ See section "Functions" in "Programming in Lua". --]] -require'tap_harness' +require'tap' local loadstring = loadstring or load plan(68) diff --git a/test/lua-Harness-tests/213-closure.t b/test/lua-Harness-tests/213-closure.t index 16a8a215..fc3bd29c 100755 --- a/test/lua-Harness-tests/213-closure.t +++ b/test/lua-Harness-tests/213-closure.t @@ -24,7 +24,7 @@ See section "Closures" in "Programming in Lua". --]] -require'tap_harness' +require'tap' plan(15) diff --git a/test/lua-Harness-tests/214-coroutine.t b/test/lua-Harness-tests/214-coroutine.t index 1ca1cb57..92929e1b 100755 --- a/test/lua-Harness-tests/214-coroutine.t +++ b/test/lua-Harness-tests/214-coroutine.t @@ -30,7 +30,7 @@ See section "Coroutines" in "Programming in Lua". --]] -require'tap_harness' +require'tap' local profile = require'profile' local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') local has_coroutine52 = _VERSION >= 'Lua 5.2' or jit diff --git a/test/lua-Harness-tests/221-table.t b/test/lua-Harness-tests/221-table.t index 07ac9521..c064a339 100755 --- a/test/lua-Harness-tests/221-table.t +++ b/test/lua-Harness-tests/221-table.t @@ -24,7 +24,7 @@ See section "Tables" in "Programming in Lua". --]] -require'tap_harness' +require'tap' plan(25) diff --git a/test/lua-Harness-tests/222-constructor.t b/test/lua-Harness-tests/222-constructor.t index 28037bfc..a01be2ec 100755 --- a/test/lua-Harness-tests/222-constructor.t +++ b/test/lua-Harness-tests/222-constructor.t @@ -30,7 +30,7 @@ See section "Table Constructors" in "Programming in Lua". --]] -require'tap_harness' +require'tap' plan(16) diff --git a/test/lua-Harness-tests/223-iterator.t b/test/lua-Harness-tests/223-iterator.t index 073f3cdc..777ad73d 100755 --- a/test/lua-Harness-tests/223-iterator.t +++ b/test/lua-Harness-tests/223-iterator.t @@ -25,7 +25,7 @@ section "Coroutines as Iterators" in "Programming in Lua". --]] -require'tap_harness' +require'tap' plan(8) diff --git a/test/lua-Harness-tests/231-metatable.t b/test/lua-Harness-tests/231-metatable.t index b94f608a..a2c6499b 100755 --- a/test/lua-Harness-tests/231-metatable.t +++ b/test/lua-Harness-tests/231-metatable.t @@ -30,7 +30,7 @@ See section "Metatables and Metamethods" in "Programming in Lua". --]] -require'tap_harness' +require'tap' local profile = require'profile' local has_metamethod52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52 local has_metamethod_ipairs = _VERSION == 'Lua 5.2' or profile.compat52 or profile.luajit_compat52 diff --git a/test/lua-Harness-tests/232-object.t b/test/lua-Harness-tests/232-object.t index 0d222324..0d875729 100755 --- a/test/lua-Harness-tests/232-object.t +++ b/test/lua-Harness-tests/232-object.t @@ -24,7 +24,7 @@ See section "Object-Oriented Programming" in "Programming in Lua". --]] -require'tap_harness' +require'tap' plan(18) diff --git a/test/lua-Harness-tests/241-standalone.t.disabled b/test/lua-Harness-tests/241-standalone.t.disabled index 33d5159c..c5237eed 100755 --- a/test/lua-Harness-tests/241-standalone.t.disabled +++ b/test/lua-Harness-tests/241-standalone.t.disabled @@ -28,7 +28,7 @@ L --]] -require'tap_harness' +require'tap' local has_bytecode = not ujit and not ravi local has_error52 = _VERSION >= 'Lua 5.2' local has_error53 = _VERSION >= 'Lua 5.3' @@ -228,14 +228,14 @@ end like(f:read'*l', "^usage: ", "no file") f:close() -cmd = lua .. [[ -ltap_harness -e "print(type(ok))"]] +cmd = lua .. [[ -ltap -e "print(type(ok))"]] f = io.popen(cmd) -is(f:read'*l', 'function', "-ltap_harness") +is(f:read'*l', 'function', "-ltap") f:close() -cmd = lua .. [[ -l tap_harness -e "print(type(ok))"]] +cmd = lua .. [[ -l tap -e "print(type(ok))"]] f = io.popen(cmd) -is(f:read'*l', 'function', "-l tap_harness") +is(f:read'*l', 'function', "-l tap") f:close() cmd = lua .. [[ -l lpeg -e "print(1)" 2>&1]] diff --git a/test/lua-Harness-tests/242-luac.t b/test/lua-Harness-tests/242-luac.t index 9a3a3c3b..a95a334a 100755 --- a/test/lua-Harness-tests/242-luac.t +++ b/test/lua-Harness-tests/242-luac.t @@ -28,7 +28,7 @@ L --]] -require'tap_harness' +require'tap' if jit then skip_all("LuaJIT") diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t index 13472cd2..0489c707 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local has_error53 = _VERSION >= 'Lua 5.3' local has_gcinfo = _VERSION == 'Lua 5.1' diff --git a/test/lua-Harness-tests/303-package.t b/test/lua-Harness-tests/303-package.t index 996ce226..7e5216d8 100755 --- a/test/lua-Harness-tests/303-package.t +++ b/test/lua-Harness-tests/303-package.t @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') local has_loaders = _VERSION == 'Lua 5.1' @@ -130,9 +130,9 @@ end -- searchpath if has_searcherpath then - local p = package.searchpath('tap_harness', package.path) + local p = package.searchpath('tap', package.path) type_ok(p, 'string', "searchpath") - p = package.searchpath('tap_harness', 'bad path') + p = package.searchpath('tap', 'bad path') is(p, nil) else is(package.searchpath, nil, "no package.searchpath") diff --git a/test/lua-Harness-tests/304-string.t b/test/lua-Harness-tests/304-string.t index 293fd8e5..991600a7 100755 --- a/test/lua-Harness-tests/304-string.t +++ b/test/lua-Harness-tests/304-string.t @@ -30,7 +30,7 @@ L ]] -require'tap_harness' +require'tap' local profile = require'profile' local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') local has_dump53 = _VERSION >= 'Lua 5.3' or jit diff --git a/test/lua-Harness-tests/305-utf8.t.disabled b/test/lua-Harness-tests/305-utf8.t.disabled index 59a2e6bd..4304b6c5 100755 --- a/test/lua-Harness-tests/305-utf8.t.disabled +++ b/test/lua-Harness-tests/305-utf8.t.disabled @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require 'tap' local profile = require'profile' local has_utf8 = _VERSION >= 'Lua 5.3' or (jit and jit.version:match'moonjit') or profile.utf8 diff --git a/test/lua-Harness-tests/306-table.t b/test/lua-Harness-tests/306-table.t index 6e764922..98366556 100755 --- a/test/lua-Harness-tests/306-table.t +++ b/test/lua-Harness-tests/306-table.t @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') local has_foreach = _VERSION == 'Lua 5.1' diff --git a/test/lua-Harness-tests/307-math.t b/test/lua-Harness-tests/307-math.t index 762567fc..8b51ed16 100755 --- a/test/lua-Harness-tests/307-math.t +++ b/test/lua-Harness-tests/307-math.t @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local has_integer = _VERSION >= 'Lua 5.3' or (jit and jit.version:match'moonjit') or profile.integer local has_mathx = _VERSION < 'Lua 5.3' or profile.compat52 or profile.compat53 or profile.has_mathx diff --git a/test/lua-Harness-tests/308-io.t b/test/lua-Harness-tests/308-io.t index 1945ce3e..35d39c02 100755 --- a/test/lua-Harness-tests/308-io.t +++ b/test/lua-Harness-tests/308-io.t @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') local has_write51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit) diff --git a/test/lua-Harness-tests/309-os.t b/test/lua-Harness-tests/309-os.t index 6b3ea4d1..87b41ca5 100755 --- a/test/lua-Harness-tests/309-os.t +++ b/test/lua-Harness-tests/309-os.t @@ -30,7 +30,7 @@ L --]] -require'tap_harness' +require'tap' local profile = require'profile' local luajit20 = jit and (jit.version_num < 20100 and not jit.version:match'^RaptorJIT') local has_execute51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit) diff --git a/test/lua-Harness-tests/310-debug.t b/test/lua-Harness-tests/310-debug.t index 63194ac3..f78af03f 100755 --- a/test/lua-Harness-tests/310-debug.t +++ b/test/lua-Harness-tests/310-debug.t @@ -30,7 +30,7 @@ L ]] -require'tap_harness' +require 'tap' local profile = require'profile' local has_getfenv = _VERSION == 'Lua 5.1' local has_gethook54 = _VERSION >= 'Lua 5.4' diff --git a/test/lua-Harness-tests/311-bit32.t b/test/lua-Harness-tests/311-bit32.t index a314f479..7023906e 100755 --- a/test/lua-Harness-tests/311-bit32.t +++ b/test/lua-Harness-tests/311-bit32.t @@ -29,7 +29,7 @@ L --]] -require'tap_harness' +require 'tap' local profile = require'profile' local has_bit32 = _VERSION == 'Lua 5.2' or profile.compat52 or profile.has_bit32 diff --git a/test/lua-Harness-tests/314-regex.t b/test/lua-Harness-tests/314-regex.t index ac7ad80e..ad4554cd 100755 --- a/test/lua-Harness-tests/314-regex.t +++ b/test/lua-Harness-tests/314-regex.t @@ -49,7 +49,7 @@ Description of the test. --]] -require'tap_harness' +require'tap' local loadstring = loadstring or load plan(162) diff --git a/test/lua-Harness-tests/320-stdin.t b/test/lua-Harness-tests/320-stdin.t index a0eabcb1..4828285d 100755 --- a/test/lua-Harness-tests/320-stdin.t +++ b/test/lua-Harness-tests/320-stdin.t @@ -24,7 +24,7 @@ Tests Lua Basic & IO Libraries with stdin --]] -require'tap_harness' +require'tap' local lua = get_lua_binary_name() diff --git a/test/lua-Harness-tests/401-bitop.t b/test/lua-Harness-tests/401-bitop.t index d1225bd0..f95aebf3 100755 --- a/test/lua-Harness-tests/401-bitop.t +++ b/test/lua-Harness-tests/401-bitop.t @@ -24,7 +24,7 @@ See L. --]] -require'tap_harness' +require 'tap' if not jit then skip_all("only with LuaJIT") diff --git a/test/lua-Harness-tests/402-ffi.t b/test/lua-Harness-tests/402-ffi.t index 2423b2ea..a2e32a54 100755 --- a/test/lua-Harness-tests/402-ffi.t +++ b/test/lua-Harness-tests/402-ffi.t @@ -24,7 +24,7 @@ See L. --]] -require'tap_harness' +require 'tap' if not jit then skip_all("only with LuaJIT") diff --git a/test/lua-Harness-tests/403-jit.t b/test/lua-Harness-tests/403-jit.t index 6c0870a2..0073c90d 100755 --- a/test/lua-Harness-tests/403-jit.t +++ b/test/lua-Harness-tests/403-jit.t @@ -24,7 +24,7 @@ See L. --]] -require'tap_harness' +require 'tap' local profile = require'profile' if not jit then diff --git a/test/lua-Harness-tests/404-ext.t b/test/lua-Harness-tests/404-ext.t index 906ed512..22a52c72 100755 --- a/test/lua-Harness-tests/404-ext.t +++ b/test/lua-Harness-tests/404-ext.t @@ -24,7 +24,7 @@ See L. --]] -require'tap_harness' +require 'tap' local profile = require'profile' local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') diff --git a/test/lua-Harness-tests/411-luajit.t.disabled b/test/lua-Harness-tests/411-luajit.t.disabled index b8cb5475..feb752eb 100755 --- a/test/lua-Harness-tests/411-luajit.t.disabled +++ b/test/lua-Harness-tests/411-luajit.t.disabled @@ -24,7 +24,7 @@ See L --]] -require'tap_harness' +require'tap' local profile = require'profile' if not jit or ujit then diff --git a/test/lua-Harness-tests/CMakeLists.txt b/test/lua-Harness-tests/CMakeLists.txt index e28cadd9..e62f2d12 100644 --- a/test/lua-Harness-tests/CMakeLists.txt +++ b/test/lua-Harness-tests/CMakeLists.txt @@ -10,7 +10,10 @@ if(NOT PROVE) return() endif() +set(LUA_TEST_SUFFIX .t) set(LUA_TEST_FLAGS --failures --shuffle) +file(GLOB TEST_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/*${LUA_TEST_SUFFIX}) + if(CMAKE_VERBOSE_MAKEFILE) list(APPEND LUA_TEST_FLAGS --verbose) endif() @@ -26,18 +29,7 @@ string(CONCAT LUA_CPATH "${LUAJIT_SOURCE_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;" ) -# FIXME: Until https://github.com/tarantool/tarantool/issues/5040 -# is resolved, Tarantool enters interactive mode if prove input -# is not stdin. As a result test hungs and not run at all. -# This part should be dropped, and argument to prove is passed -# as directory. -file(GLOB TESTS_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.t) -string(REPLACE ";" "\n" TESTS_LIST "${TESTS_LIST}") -set(LIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/tests_list) -file(WRITE ${LIST_FILE} ${TESTS_LIST}) - -add_custom_target(lua-Harness-tests DEPENDS ${LUAJIT_TEST_BINARY} ${LIST_FILE}) - +add_custom_target(lua-Harness-tests DEPENDS ${LUAJIT_TEST_BINARY} ${TEST_DEPS}) add_custom_command(TARGET lua-Harness-tests COMMENT "Running lua-Harness tests" COMMAND @@ -53,8 +45,9 @@ add_custom_command(TARGET lua-Harness-tests # XXX: Adapt to run test witht Tarantool on read-only # file systems with dofile(CUR_SOURCE_DIR..filename). CUR_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} - ${PROVE} - < ${LIST_FILE} + ${PROVE} ${CMAKE_CURRENT_SOURCE_DIR} --exec '${LUAJIT_TEST_COMMAND} -l profile_luajit21' + --ext ${LUA_TEST_SUFFIX} ${LUA_TEST_FLAGS} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/test/lua-Harness-tests/tap_harness.lua b/test/lua-Harness-tests/tap.lua similarity index 100% rename from test/lua-Harness-tests/tap_harness.lua rename to test/lua-Harness-tests/tap.lua ================================================================================ The incremental patch for Tarantool "unloading" its tap: ================================================================================ diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake index 1c05e085b..e00817a8f 100644 --- a/cmake/luajit.cmake +++ b/cmake/luajit.cmake @@ -40,16 +40,18 @@ set(LUAJIT_TEST_BINARY $ CACHE STRING set(LUAJIT_USE_TEST OFF CACHE BOOL "Generate target" FORCE) -# Enable internal LuaJIT assertions for Tarantool Debug build. # XXX: There is module enabled by default in Tarantool # built in Debug, so we need to tweak LuaJIT testing environment. +# TODO: Drop a few words regarding TAP. +set(LUAJIT_TEST_INIT "${PROJECT_SOURCE_DIR}/test/luajit-test-init.lua" + CACHE STRING "Lua code need to be run before tests are started" FORCE) + +# Enable internal LuaJIT assertions for Tarantool Debug build. if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(LUAJIT_USE_APICHECK ON CACHE BOOL "Assertions for the Lua/C API" FORCE) set(LUAJIT_USE_ASSERT ON CACHE BOOL "Assertions for the whole LuaJIT VM" FORCE) - set(LUAJIT_TEST_INIT "${PROJECT_SOURCE_DIR}/test/luajit-test-init.lua" - CACHE STRING "Lua code need to be run before tests are started" FORCE) endif() # Valgrind can be used only with the system allocator. For more diff --git a/test/luajit-test-init.lua b/test/luajit-test-init.lua index a529e9d8a..199d34f3f 100644 --- a/test/luajit-test-init.lua +++ b/test/luajit-test-init.lua @@ -1,6 +1,9 @@ -- Disable strict for Tarantool. require("strict").off() +-- TODO: Drop a few words regarding this. +package.loaded.tap = nil + -- Add `strict.off()` to `progname` command, that runs child tests -- in some LuaJIT test suites to disable strict there too. -- Quotes type is important. ================================================================================ > [1]: https://framagit.org/fperrad/lua-Harness [2]: https://github.com/tarantool/tarantool/commit/b4f2911 -- Best regards, IM