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 C8A0970310; Thu, 4 Mar 2021 13:30:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C8A0970310 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614853827; bh=DJgf0SIROQREEKf1PS9mqrHKmTGwLT7bmXGI+wKGi/0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=yTqcAy4EmRBmGzqruke7OzuM8qXKA9Xu4JzZJHV0LC4WEss6mM0/cMzuvJv3Lt7cb rTq9A5ai/BQRnVfkGlKRVmekTHKrpGPZibQlwW571GBvgS4HglYNhl5leXO/UOU2K0 5sWXcDRGgJISE9XblsnhNzjcJktKPQUNqLAzxitQ= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 1030274CC6 for ; Thu, 4 Mar 2021 13:25:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1030274CC6 Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lHlAI-0000fx-DB; Thu, 04 Mar 2021 13:25:07 +0300 To: Sergey Ostanevich , Igor Munkin Date: Thu, 4 Mar 2021 13:23:58 +0300 Message-Id: <74f2fc45464dcfde8ab94f7096a9a554cabf4695.1614847731.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92A98208ECBDD29F5D89ACCED453B3B3D46194CE92B29E17D182A05F5380850400EC8399606A9B5F328757CCC7787AEA0D8E52BB523895FDDDDFD849DA446FD23 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7081BBE264C6D7F42EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378010A306A5B6F90A8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC7FFBF58D524698ADE9D8CD94C0E5EC6CAA524CDB089EB815389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92A417C69337E82CC2CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FCC6A536F79815AD9275ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E735F65A62F6C9828292C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F5D41B9178041F3E72623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC7FFBF58D524698ADE9D8CD94C0E5EC6C59D602AD5D1F2E40B1881A6453793CE9C32612AADDFBE061C61BE10805914D3804EBA3D8E7E5B87ABF8C51168CD8EBDB791E6C230873D55CDC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3468964757141B82E0CC91B75F30BC3CC15431DDCD5CC67B3C3F87944D58D8B87C4D70BFCD4AEFDD821D7E09C32AA3244C9425DC03F28E6B9958EB8124DC91312D795D98D676DD64D0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojSsmoOoMLSh3ya+Z84Mg0Hg== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB457442BD5395DD839ABF93359CF19A829C1F8EECA61A04305F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [Tarantool-patches] [WIP luajit 11/15] 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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. 203-lexico.t and 301-basic.t is adjusted to valid working with out-of-source build in Tarantool CI. 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. Part of tarantool/tarantool#5844 Part of tarantool/tarantool#4473 --- Mergen Imeev : Author Sergey Kaplun : glanced commit message, made commit consistence with the tarantool branch. .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/.gitignore b/.gitignore index 2103a30..1fb81bc 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ 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 92f04d8..99932f2 100755 --- a/test/lua-Harness-tests/090-tap.t +++ b/test/lua-Harness-tests/090-tap.t @@ -22,7 +22,7 @@ ]] -require'tap' +require'tap_harness' plan(3) ok( true, 'ok' ) diff --git a/test/lua-Harness-tests/091-profile.t b/test/lua-Harness-tests/091-profile.t index db47438..ebc142d 100755 --- a/test/lua-Harness-tests/091-profile.t +++ b/test/lua-Harness-tests/091-profile.t @@ -22,7 +22,7 @@ ]] -require'tap' +require'tap_harness' plan'no_plan' diff --git a/test/lua-Harness-tests/101-boolean.t b/test/lua-Harness-tests/101-boolean.t index 0033eff..653509f 100755 --- a/test/lua-Harness-tests/101-boolean.t +++ b/test/lua-Harness-tests/101-boolean.t @@ -22,7 +22,7 @@ ]] -require'tap' +require'tap_harness' 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 48ed814..cb7e9d0 100755 --- a/test/lua-Harness-tests/102-function.t +++ b/test/lua-Harness-tests/102-function.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 561b101..a74c491 100755 --- a/test/lua-Harness-tests/103-nil.t +++ b/test/lua-Harness-tests/103-nil.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 0d4d3fd..634d22a 100755 --- a/test/lua-Harness-tests/104-number.t +++ b/test/lua-Harness-tests/104-number.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 cd8c88b..f2ea067 100755 --- a/test/lua-Harness-tests/105-string.t +++ b/test/lua-Harness-tests/105-string.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 0c0ba49..4a66f69 100755 --- a/test/lua-Harness-tests/106-table.t +++ b/test/lua-Harness-tests/106-table.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 3d4af18..e67ef36 100755 --- a/test/lua-Harness-tests/107-thread.t +++ b/test/lua-Harness-tests/107-thread.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 b1e3641..687b1b8 100755 --- a/test/lua-Harness-tests/108-userdata.t +++ b/test/lua-Harness-tests/108-userdata.t @@ -22,7 +22,7 @@ --]] -require'tap' +require'tap_harness' 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 362aae3..cb06a80 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' +require'tap_harness' plan(5) diff --git a/test/lua-Harness-tests/201-assign.t b/test/lua-Harness-tests/201-assign.t index 7d023d8..f7ed472 100755 --- a/test/lua-Harness-tests/201-assign.t +++ b/test/lua-Harness-tests/201-assign.t @@ -28,7 +28,7 @@ L --]] -require'tap' +require'tap_harness' 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 2576750..f03d5ea 100755 --- a/test/lua-Harness-tests/202-expr.t +++ b/test/lua-Harness-tests/202-expr.t @@ -28,7 +28,7 @@ L --]] -require'tap' +require'tap_harness' 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 c1abebf..0a73f8c 100755 --- a/test/lua-Harness-tests/203-lexico.t +++ b/test/lua-Harness-tests/203-lexico.t @@ -31,7 +31,7 @@ L --]] -require'tap' +require'tap_harness' local loadstring = loadstring or load local luajit21 = jit and (jit.version_num >= 20100 or jit.version:match'^RaptorJIT') @@ -117,20 +117,24 @@ 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') .. '/' + if _VERSION >= 'Lua 5.2' or jit then - dofile'lexico52/lexico.t' + dofile(path_to_sources .. 'lexico52/lexico.t') end if _VERSION >= 'Lua 5.3' or luajit21 then - dofile'lexico53/lexico.t' + dofile(path_to_sources .. 'lexico53/lexico.t') end if _VERSION >= 'Lua 5.4' then - dofile'lexico54/lexico.t' + dofile(path_to_sources .. 'lexico54/lexico.t') end if jit and pcall(require, 'ffi') then - dofile'lexicojit/lexico.t' + dofile(path_to_sources .. 'lexicojit/lexico.t') end done_testing() diff --git a/test/lua-Harness-tests/204-grammar.t b/test/lua-Harness-tests/204-grammar.t index d9ae3a6..03580f4 100755 --- a/test/lua-Harness-tests/204-grammar.t +++ b/test/lua-Harness-tests/204-grammar.t @@ -28,7 +28,7 @@ L --]] -require'tap' +require'tap_harness' 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 64eed52..8e26a6f 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' +require'tap_harness' plan(10) diff --git a/test/lua-Harness-tests/212-function.t b/test/lua-Harness-tests/212-function.t index 2851053..405035e 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' +require'tap_harness' 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 fc3bd29..16a8a21 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' +require'tap_harness' plan(15) diff --git a/test/lua-Harness-tests/214-coroutine.t b/test/lua-Harness-tests/214-coroutine.t index 92929e1..1ca1cb5 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' +require'tap_harness' 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 7ed6c65..0caf037 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' +require'tap_harness' plan(25) diff --git a/test/lua-Harness-tests/222-constructor.t b/test/lua-Harness-tests/222-constructor.t index a01be2e..28037bf 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' +require'tap_harness' plan(16) diff --git a/test/lua-Harness-tests/223-iterator.t b/test/lua-Harness-tests/223-iterator.t index 777ad73..073f3cd 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' +require'tap_harness' plan(8) diff --git a/test/lua-Harness-tests/231-metatable.t b/test/lua-Harness-tests/231-metatable.t index a2c6499..b94f608 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' +require'tap_harness' 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 0d87572..0d22232 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' +require'tap_harness' plan(18) diff --git a/test/lua-Harness-tests/241-standalone.t b/test/lua-Harness-tests/241-standalone.t index c99f324..4916ccc 100755 --- a/test/lua-Harness-tests/241-standalone.t +++ b/test/lua-Harness-tests/241-standalone.t @@ -28,7 +28,7 @@ L --]] -require'tap' +require'tap_harness' 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 -e "print(type(ok))"]] +cmd = lua .. [[ -ltap_harness -e "print(type(ok))"]] 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]] diff --git a/test/lua-Harness-tests/242-luac.t b/test/lua-Harness-tests/242-luac.t index 2d166e5..da54f68 100755 --- a/test/lua-Harness-tests/242-luac.t +++ b/test/lua-Harness-tests/242-luac.t @@ -28,7 +28,7 @@ L --]] -require'tap' +require'tap_harness' 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 e45599e..e119933 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -30,7 +30,7 @@ L --]] -require'tap' +require'tap_harness' local profile = require'profile' local has_error53 = _VERSION >= 'Lua 5.3' local has_gcinfo = _VERSION == 'Lua 5.1' @@ -843,7 +843,10 @@ do -- xpcall end if jit and pcall(require, 'ffi') then - dofile'lexicojit/basic.t' + -- 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') end done_testing() diff --git a/test/lua-Harness-tests/303-package.t b/test/lua-Harness-tests/303-package.t index 7e5216d..996ce22 100755 --- a/test/lua-Harness-tests/303-package.t +++ b/test/lua-Harness-tests/303-package.t @@ -30,7 +30,7 @@ L --]] -require'tap' +require'tap_harness' 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', package.path) + local p = package.searchpath('tap_harness', package.path) type_ok(p, 'string', "searchpath") - p = package.searchpath('tap', 'bad path') + p = package.searchpath('tap_harness', '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 991600a..293fd8e 100755 --- a/test/lua-Harness-tests/304-string.t +++ b/test/lua-Harness-tests/304-string.t @@ -30,7 +30,7 @@ L ]] -require'tap' +require'tap_harness' 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 b/test/lua-Harness-tests/305-utf8.t index 4304b6c..59a2e6b 100755 --- a/test/lua-Harness-tests/305-utf8.t +++ b/test/lua-Harness-tests/305-utf8.t @@ -30,7 +30,7 @@ L --]] -require 'tap' +require'tap_harness' 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 9836655..6e76492 100755 --- a/test/lua-Harness-tests/306-table.t +++ b/test/lua-Harness-tests/306-table.t @@ -30,7 +30,7 @@ L --]] -require'tap' +require'tap_harness' 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 8b51ed1..762567f 100755 --- a/test/lua-Harness-tests/307-math.t +++ b/test/lua-Harness-tests/307-math.t @@ -30,7 +30,7 @@ L --]] -require'tap' +require'tap_harness' 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 cdbcb83..ec6ac9d 100755 --- a/test/lua-Harness-tests/308-io.t +++ b/test/lua-Harness-tests/308-io.t @@ -30,7 +30,7 @@ L --]] -require'tap' +require'tap_harness' 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 e42fb53..b34ade5 100755 --- a/test/lua-Harness-tests/309-os.t +++ b/test/lua-Harness-tests/309-os.t @@ -30,7 +30,7 @@ L --]] -require'tap' +require'tap_harness' 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 f78af03..63194ac 100755 --- a/test/lua-Harness-tests/310-debug.t +++ b/test/lua-Harness-tests/310-debug.t @@ -30,7 +30,7 @@ L ]] -require 'tap' +require'tap_harness' 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 7023906..a314f47 100755 --- a/test/lua-Harness-tests/311-bit32.t +++ b/test/lua-Harness-tests/311-bit32.t @@ -29,7 +29,7 @@ L --]] -require 'tap' +require'tap_harness' 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 ad4554c..ac7ad80 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' +require'tap_harness' 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 36528e8..0c348d7 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' +require'tap_harness' local lua = arg[-3] or arg[-1] diff --git a/test/lua-Harness-tests/401-bitop.t b/test/lua-Harness-tests/401-bitop.t index f95aebf..d1225bd 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' +require'tap_harness' 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 a2e32a5..2423b2e 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' +require'tap_harness' 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 0073c90..6c0870a 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' +require'tap_harness' 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 22a52c7..906ed51 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' +require'tap_harness' 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 b/test/lua-Harness-tests/411-luajit.t index 05111be..e6bf031 100755 --- a/test/lua-Harness-tests/411-luajit.t +++ b/test/lua-Harness-tests/411-luajit.t @@ -24,7 +24,7 @@ See L --]] -require'tap' +require'tap_harness' 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 9b35e5a..e28cadd 100644 --- a/test/lua-Harness-tests/CMakeLists.txt +++ b/test/lua-Harness-tests/CMakeLists.txt @@ -26,7 +26,17 @@ string(CONCAT LUA_CPATH "${LUAJIT_SOURCE_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;" ) -add_custom_target(lua-Harness-tests DEPENDS ${LUAJIT_TEST_BINARY}) +# 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_command(TARGET lua-Harness-tests COMMENT "Running lua-Harness tests" @@ -40,7 +50,10 @@ 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. - ${PROVE} ${CMAKE_CURRENT_SOURCE_DIR} + # 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} --exec '${LUAJIT_TEST_COMMAND} -l profile_luajit21' ${LUA_TEST_FLAGS} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap_harness.lua similarity index 100% rename from test/lua-Harness-tests/tap.lua rename to test/lua-Harness-tests/tap_harness.lua -- 2.28.0