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 C552E6EC43; Mon, 5 Jul 2021 15:13:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C552E6EC43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625487191; bh=KEMCSd8a4rvDKvEResLl79ptAf9P8sjQuXlEN6KTPjQ=; 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=XAII9XcfSSOmmoqZAtFUeFTPouvKa+GfkCCGTHOZRlEgUOGFucRpbuNfoQDFxvj7H UHRySrfrV3cTMh1KozFSDk4T3KCLmsU8WSR3xNXpgNNpvnT+3H/0PEZRU2lZhUalWM Ao7u4NaJlhl9EPOl5/wWhN7gcTAczLKW9OkH/Q58= Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 EED996EC42 for ; Mon, 5 Jul 2021 14:50:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EED996EC42 Received: by mail-lf1-f46.google.com with SMTP id q18so31984484lfc.7 for ; Mon, 05 Jul 2021 04:50:10 -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=quRKhXZvK5JzC8XJSXEBe8tmXqK2TFTbNxCms23OKX4=; b=GcNiAIGsJsdeMroSKbW+ngyzqUOLF9E1z/6hoPEnVVHl5ooDnc8WFzv58bYQXiq3V0 LOMt3vNVRQ3abU6Vnl6lrwnUvWYPkcKV8UfX2lIYl0/yo1kmiOViWVcIYHsHGfTR8jxN Fv2F9uZxnP1HNt6gDPQt6BpwZIUP+pRhhmwWzfpvKahMvqsdrXn0cQIm4YFUlfHO8E9q nRYLRxwrLhtkY7vZPrMAG8dTUVYuIpLqiS4/A5gOFXPVVduhsIRJi4/WKk3X6UHLcLhS EoQyFbz3u6eOIH20IVpFJq5QYSJnd9iR4uTRgs4MU/Bzizynzg3z6FviNRyck6xU0n7e A9tg== X-Gm-Message-State: AOAM530c4bAf3cKD63KArdQKSArvVyuvta52TzxF7rtjQkfxCwxk8Jym 6yL3THypAFcWtf8E7BjxVkhUS8OOPKgYpR70e+M= X-Google-Smtp-Source: ABdhPJyl7zuklQeSt3Fw2V4yySne/aEJmDdRPXWboUL1DAuSSoxOAUrl2UqxW7bs0rTHXNlS4mmjhQ== X-Received: by 2002:a05:6512:943:: with SMTP id u3mr10113965lft.413.1625485810279; Mon, 05 Jul 2021 04:50:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 04:50:09 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org Date: Mon, 5 Jul 2021 14:49:42 +0300 Message-Id: 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 1/4] test: resolving program name 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@1be25a8` from lua-Harness suite is the same as the patch `tarantool/luajit@8376885`, except for `get_lua_binary_name()`, which was renamed to `_retrieve_progname()` in `fperadd/lua-Harness`. test/lua-Harness-tests/241-standalone.t.disabled | 2 +- test/lua-Harness-tests/242-luac.t | 2 +- test/lua-Harness-tests/301-basic.t | 2 +- test/lua-Harness-tests/308-io.t | 2 +- test/lua-Harness-tests/309-os.t | 2 +- test/lua-Harness-tests/320-stdin.t | 2 +- test/lua-Harness-tests/411-luajit.t.disabled | 2 +- test/lua-Harness-tests/tap.lua | 8 ++++++++ 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test/lua-Harness-tests/241-standalone.t.disabled b/test/lua-Harness-tests/241-standalone.t.disabled index c5237eed..b8b6aa60 100755 --- a/test/lua-Harness-tests/241-standalone.t.disabled +++ b/test/lua-Harness-tests/241-standalone.t.disabled @@ -41,7 +41,7 @@ elseif ravi then banner = '^Ravi %d%.%d%.%d' end -local lua = get_lua_binary_name() +local lua = _retrieve_progname() local luac = jit and lua or (lua .. 'c') if not pcall(io.popen, lua .. [[ -e "a=1"]]) then diff --git a/test/lua-Harness-tests/242-luac.t b/test/lua-Harness-tests/242-luac.t index a95a334a..93c990ed 100755 --- a/test/lua-Harness-tests/242-luac.t +++ b/test/lua-Harness-tests/242-luac.t @@ -38,7 +38,7 @@ if ravi then skip_all("ravi") end -local lua = get_lua_binary_name() +local lua = _retrieve_progname() local luac = lua .. 'c' if not pcall(io.popen, lua .. [[ -e "a=1"]]) then diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t index a4bb09ff..a4fe6381 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -48,7 +48,7 @@ local has_warn = _VERSION >= 'Lua 5.4' local has_xpcall52 = _VERSION >= 'Lua 5.2' or jit local has_xpcall53 = _VERSION >= 'Lua 5.3' or jit -local lua = get_lua_binary_name() +local lua = _retrieve_progname() plan'no_plan' diff --git a/test/lua-Harness-tests/308-io.t b/test/lua-Harness-tests/308-io.t index 35d39c02..dfe2d832 100755 --- a/test/lua-Harness-tests/308-io.t +++ b/test/lua-Harness-tests/308-io.t @@ -40,7 +40,7 @@ local has_read53 = _VERSION >= 'Lua 5.3' or luajit21 local has_meta53 = _VERSION >= 'Lua 5.3' local has_meta54 = _VERSION >= 'Lua 5.4' -local lua = get_lua_binary_name() +local lua = _retrieve_progname() plan'no_plan' diff --git a/test/lua-Harness-tests/309-os.t b/test/lua-Harness-tests/309-os.t index a787b147..8258e8af 100755 --- a/test/lua-Harness-tests/309-os.t +++ b/test/lua-Harness-tests/309-os.t @@ -34,7 +34,7 @@ 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) -local lua = get_lua_binary_name() +local lua = _retrieve_progname() plan'no_plan' diff --git a/test/lua-Harness-tests/320-stdin.t b/test/lua-Harness-tests/320-stdin.t index 4828285d..8b19c5c5 100755 --- a/test/lua-Harness-tests/320-stdin.t +++ b/test/lua-Harness-tests/320-stdin.t @@ -26,7 +26,7 @@ Tests Lua Basic & IO Libraries with stdin require'tap' -local lua = get_lua_binary_name() +local lua = _retrieve_progname() if not pcall(io.popen, lua .. [[ -e "a=1"]]) then skip_all "io.popen not supported" diff --git a/test/lua-Harness-tests/411-luajit.t.disabled b/test/lua-Harness-tests/411-luajit.t.disabled index feb752eb..25c3ee52 100755 --- a/test/lua-Harness-tests/411-luajit.t.disabled +++ b/test/lua-Harness-tests/411-luajit.t.disabled @@ -31,7 +31,7 @@ if not jit or ujit then skip_all("only with LuaJIT") end -local lua = get_lua_binary_name() +local lua = _retrieve_progname() if not pcall(io.popen, lua .. [[ -e "a=1"]]) then skip_all("io.popen not supported") diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua index a8454ae0..86cca4e0 100644 --- a/test/lua-Harness-tests/tap.lua +++ b/test/lua-Harness-tests/tap.lua @@ -9,6 +9,14 @@ ]] +function _retrieve_progname () + local i = 0 + while arg[i] do + i = i - 1 + end + return arg[i + 1] +end + if pcall(require, 'Test.More') then diag 'Test.More loaded' return -- 2.31.1