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 577526EC5B; Mon, 5 Jul 2021 15:13:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 577526EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625487192; bh=rtsfwnTcxkQDmB6WWj/Y0D4I1jmjrs3aNv/1JzBec8w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pwZa9xmqa8N8GNEAAPf5LLJ/BmchaLJQqQcbqnr0d5HDVwSyrvEInViCcvB9+cXKW +JYpsIf/bKgCUGxyBBBrjvbQKvu+wHytM6cA5XucR4H4KGUs8UkMftkccrhnXi1ZvC oxE5CI+RKdi12odAUBlw/eD+wO06CK6eFfdnjTkk= Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CB1FB6EC40 for ; Mon, 5 Jul 2021 14:50:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CB1FB6EC40 Received: by mail-lf1-f47.google.com with SMTP id p21so10264992lfj.13 for ; Mon, 05 Jul 2021 04:50:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p9dotIZ87gQeGMqYWqF4CW00BSqYZbi0cZb40y1RkA4=; b=Bpgf3eHzd8ME8OprxRmTKntyJQM506XeX5w4S7JtNKsQmSqKlGR+ZFSxCsLny29nFH v/ixJh0PAO7SJl3IahtFDdIS0vUjMGS0/cnHm0LGPd2ZnW35GaFYnSsrlE/3lbKTTgUt TDTNUiHsNHeT/SM/o9bAy8V8hxEwxynwTiwS1/S29sbGKrwtjWekpoSaHEyapk0YjXhm dsHUFBGlzQ0DIXonzXltQBAYwm+fXrC2htVWwiKQkMV7kUvm9ccr6WQ2BME39lpx1esb mAK45VyLZiXG/Z4SSNsmydGTNTzq7Pw84SgedOaY94U4gvvct26mzbD3O8CylooWHdCk cQoA== X-Gm-Message-State: AOAM530hyCT0r0Pmmog/qeK2DOBJn6Wg/pfvOMwXvY1DNIWVECb+/EFK ywGPbIxwSbgdHUkvGPtlSWAoJtsbj5hvpkeDnrM= X-Google-Smtp-Source: ABdhPJwIZ+a2SBGPhjMeELdeG8vfQptfuiFvE2BTxsrci7hWAoaotqhXg0INRcfOWSCnYBsN4UTxhQ== X-Received: by 2002:ac2:5519:: with SMTP id j25mr10615929lfk.431.1625485812151; Mon, 05 Jul 2021 04:50:12 -0700 (PDT) Received: from localhost.localdomain ([2a00:1370:8131:39a8:2c0a:28e8:e4ad:bc59]) by smtp.gmail.com with ESMTPSA id k8sm1059050lfc.25.2021.07.05.04.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 04:50:11 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org Date: Mon, 5 Jul 2021 14:49:43 +0300 Message-Id: <666cd23f865dbfe3b4986823fa3b9689493eff39.1625484589.git.max.kokryashkin@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 05 Jul 2021 15:13:09 +0300 Subject: [Tarantool-patches] [PATCH 2/4] test: out-of-source testing 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Maxim Kokryashkin Part of tarantool/tarantool#5970 --- The patch `fperrad/lua-Harness@60da289` is similar to the patch `tarantool/luajit@d11c5bb`, but `make_specific_checks()` was renamed to `_dofile()` by maintainer. Another difference is that it seems like there is no definition for `_dofile()` in mainline lua-Harness, so it should be user-defined somewhere. If it is not, then `_dofile()` will act like `dofile()`. Considering this, we should keep `make_specific_checks` implementation from `tarantool/luajit@d11c5bb`, but rename it to `_dofile` and move to `tap.lua`. 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/203-lexico.t | 8 ++++---- test/lua-Harness-tests/231-metatable.t | 2 +- test/lua-Harness-tests/301-basic.t | 2 +- test/lua-Harness-tests/305-utf8.t | 2 +- test/lua-Harness-tests/404-ext.t | 2 +- test/lua-Harness-tests/tap.lua | 4 ++++ 14 files changed, 20 insertions(+), 16 deletions(-) diff --git a/test/lua-Harness-tests/101-boolean.t b/test/lua-Harness-tests/101-boolean.t index c26b276e..b2014436 100755 --- a/test/lua-Harness-tests/101-boolean.t +++ b/test/lua-Harness-tests/101-boolean.t @@ -114,7 +114,7 @@ error_like(function () local a = true; a[1] = 1; end, "index") if has_op53 then - make_specific_checks'lexico53/boolean.t' + _dofile'lexico53/boolean.t' end done_testing() diff --git a/test/lua-Harness-tests/102-function.t b/test/lua-Harness-tests/102-function.t index c49afc5e..214fcb71 100755 --- a/test/lua-Harness-tests/102-function.t +++ b/test/lua-Harness-tests/102-function.t @@ -193,7 +193,7 @@ t[print] = true ok(t[print]) if has_op53 then - make_specific_checks'lexico53/function.t' + _dofile'lexico53/function.t' end done_testing() diff --git a/test/lua-Harness-tests/103-nil.t b/test/lua-Harness-tests/103-nil.t index 87a1c3b1..55f89d0d 100755 --- a/test/lua-Harness-tests/103-nil.t +++ b/test/lua-Harness-tests/103-nil.t @@ -114,7 +114,7 @@ error_like(function () local a = nil; a[1] = 1; end, "index") if has_op53 then - make_specific_checks'lexico53/nil.t' + _dofile'lexico53/nil.t' end done_testing() diff --git a/test/lua-Harness-tests/104-number.t b/test/lua-Harness-tests/104-number.t index f5b81e3d..b63f1eb0 100755 --- a/test/lua-Harness-tests/104-number.t +++ b/test/lua-Harness-tests/104-number.t @@ -233,7 +233,7 @@ error_like(function () local a = 3.14; a[1] = 1; end, "index") if has_op53 then - make_specific_checks'lexico53/number.t' + _dofile'lexico53/number.t' end done_testing() diff --git a/test/lua-Harness-tests/105-string.t b/test/lua-Harness-tests/105-string.t index 184deaba..e24d3818 100755 --- a/test/lua-Harness-tests/105-string.t +++ b/test/lua-Harness-tests/105-string.t @@ -264,7 +264,7 @@ error_like(function () a = 'text'; a[1] = 1; end, "index") if has_op53 then - make_specific_checks'lexico53/string.t' + _dofile'lexico53/string.t' end done_testing() diff --git a/test/lua-Harness-tests/106-table.t b/test/lua-Harness-tests/106-table.t index 667b9c8d..dac669fe 100755 --- a/test/lua-Harness-tests/106-table.t +++ b/test/lua-Harness-tests/106-table.t @@ -122,7 +122,7 @@ error_like(function () t = {}; t[0/0] = 42 end, "table index is NaN") if has_op53 then - make_specific_checks'lexico53/table.t' + _dofile'lexico53/table.t' end done_testing() diff --git a/test/lua-Harness-tests/107-thread.t b/test/lua-Harness-tests/107-thread.t index 5c5bf22f..bc105ff1 100755 --- a/test/lua-Harness-tests/107-thread.t +++ b/test/lua-Harness-tests/107-thread.t @@ -122,7 +122,7 @@ t[co] = true ok(t[co]) if has_op53 then - make_specific_checks'lexico53/thread.t' + _dofile'lexico53/thread.t' end done_testing() diff --git a/test/lua-Harness-tests/108-userdata.t b/test/lua-Harness-tests/108-userdata.t index 48a5f60f..8c2918e8 100755 --- a/test/lua-Harness-tests/108-userdata.t +++ b/test/lua-Harness-tests/108-userdata.t @@ -119,7 +119,7 @@ t[u] = true ok(t[u]) if has_op53 then - make_specific_checks'lexico53/userdata.t' + _dofile'lexico53/userdata.t' end done_testing() diff --git a/test/lua-Harness-tests/203-lexico.t b/test/lua-Harness-tests/203-lexico.t index 7f554820..c4a95fa3 100755 --- a/test/lua-Harness-tests/203-lexico.t +++ b/test/lua-Harness-tests/203-lexico.t @@ -118,19 +118,19 @@ do end if _VERSION >= 'Lua 5.2' or jit then - make_specific_checks'lexico52/lexico.t' + _dofile'lexico52/lexico.t' end if _VERSION >= 'Lua 5.3' or luajit21 then - make_specific_checks'lexico53/lexico.t' + _dofile'lexico53/lexico.t' end if _VERSION >= 'Lua 5.4' then - make_specific_checks'lexico54/lexico.t' + _dofile'lexico54/lexico.t' end if jit and pcall(require, 'ffi') then - make_specific_checks'lexicojit/lexico.t' + _dofile'lexicojit/lexico.t' end done_testing() diff --git a/test/lua-Harness-tests/231-metatable.t b/test/lua-Harness-tests/231-metatable.t index 97ac5420..c0b2344b 100755 --- a/test/lua-Harness-tests/231-metatable.t +++ b/test/lua-Harness-tests/231-metatable.t @@ -589,7 +589,7 @@ do end if has_anno_toclose then - make_specific_checks'lexico54/metatable.t' + _dofile'lexico54/metatable.t' end done_testing() diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t index a4fe6381..2390d694 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -843,7 +843,7 @@ do -- xpcall end if jit and pcall(require, 'ffi') then - make_specific_checks'lexicojit/basic.t' + _dofile'lexicojit/basic.t' end done_testing() diff --git a/test/lua-Harness-tests/305-utf8.t b/test/lua-Harness-tests/305-utf8.t index 6c125388..1e975e6d 100755 --- a/test/lua-Harness-tests/305-utf8.t +++ b/test/lua-Harness-tests/305-utf8.t @@ -40,7 +40,7 @@ if not utf8 then nok(has_utf8, "no has_utf8") else plan'no_plan' - make_specific_checks'lexico53/utf8.t' + _dofile'lexico53/utf8.t' if _VERSION >= 'Lua 5.4' then make_specific_checks'lexico54/utf8.t' end diff --git a/test/lua-Harness-tests/404-ext.t b/test/lua-Harness-tests/404-ext.t index a799c750..4938ea3a 100755 --- a/test/lua-Harness-tests/404-ext.t +++ b/test/lua-Harness-tests/404-ext.t @@ -158,7 +158,7 @@ end -- thread.exdata if pcall(require, 'ffi') and (profile.openresty or jit.version:match'moonjit') then - make_specific_checks'lexicojit/ext.t' + _dofile'lexicojit/ext.t' end done_testing() diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua index 86cca4e0..b17709e5 100644 --- a/test/lua-Harness-tests/tap.lua +++ b/test/lua-Harness-tests/tap.lua @@ -9,6 +9,10 @@ ]] +function _dofile (filename) + return dofile(arg[0]:gsub('([^/]+)%.t$', '') .. filename) +end + function _retrieve_progname () local i = 0 while arg[i] do -- 2.31.1