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 708876EC56; Tue, 20 Jul 2021 19:30:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 708876EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626798635; bh=wvD4dgil92+k1nsRw7oXt5MuoUOy8+eCQOPlv/UGDDA=; 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=RdCCj/XJU+JrC96d9EvRKl6w1XqgeNo3/BCLuh0MqOn9axeU2cGlYMwnId7XOS5io 7S1szRwI+0yITd0Fs+hdJRUz/CZyJy9FJR8qsd+/7Hx2GtYbAieg5RixHNQpto9/g2 tzJnf93h4o2EEiVUb4a9D6zsP8yHMVw1sAImTGe0= Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 AE54C6EC6F for ; Tue, 20 Jul 2021 19:27:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AE54C6EC6F Received: by mail-lj1-f171.google.com with SMTP id r16so31795547ljk.9 for ; Tue, 20 Jul 2021 09:27:57 -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=lAXq89LQ5vhWf/oO0WozjJyFlZHnxkqzxlIC+QBc8Ec=; b=i6S/vghoOFDVt+Eu2reSYqJcTbgkr+4dP6n91DWK3rZuWepE/NpSA4OMZaQ31A9ye3 Y1lud5/aFMiSfd+b88FFfXkwKVwXqk2NoGLgb5xLV2gTGFu4b/oymGYQGTWo1qgDoMd3 EKBTL9VugSMiU6efo/B0Npm963r/5/BwUbCqr9gtF/neLWR1d89mJ8uyJhl2zoWcJSsp 6o9GBuPUI11vXKyFW4PtNzkWOL+cKopRrdF35BzqZj+46C4rGN76Nzx/D2i9A99s5ARo jKEbFaPTCZxu6kznC+mMGor5kh5e8t7sNVxFvcFPgPVe7Siq4dKwnDHiaiM9xyyVI5x0 F5aw== X-Gm-Message-State: AOAM5332kyOp/dEw4bQ/54OJZkapUxn/kMxlRnTCQ8KCU1VpeJK/SaiE rO7gw/tKisJaSJpfg3DBPuGhGb7iO4UpQaGO X-Google-Smtp-Source: ABdhPJzKYGdsGndfMQJ6JSrQXftaceRNhBYKaTM/0dkkRjyQ3CMEYycIdmNAvM772wDoq9nQDT3U1Q== X-Received: by 2002:a2e:a44a:: with SMTP id v10mr1275461ljn.497.1626798476976; Tue, 20 Jul 2021 09:27:56 -0700 (PDT) Received: from localhost.localdomain ([2a00:1fa0:44c8:ff00:875c:6e54:99e0:fb4a]) by smtp.gmail.com with ESMTPSA id d8sm1562660lfi.129.2021.07.20.09.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 09:27:56 -0700 (PDT) X-Google-Original-From: Maxim Kokryashkin To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org Date: Tue, 20 Jul 2021 19:26:54 +0300 Message-Id: <3c7f4b9f754b86daaa59bc6663fb8235d4ee7e56.1626797225.git.m.kokryashkin@tarantool.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 06/10] test: support tarantool in lua-Harness 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" Backports 'supoort Tarantool' patch[1] from lua-Harness. [1]: https://framagit.org/fperrad/lua-Harness/-/commit/d3ceee16 Part of tarantool/tarantool#5970 Part of tarantool/tarantool#4473 --- ...standalone.t.disabled => 241-standalone.t} | 5 ++ test/lua-Harness-tests/320-stdin.t | 2 +- .../{411-luajit.t.disabled => 411-luajit.t} | 2 +- test/lua-Harness-tests/profile_tarantool.lua | 63 +++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) rename test/lua-Harness-tests/{241-standalone.t.disabled => 241-standalone.t} (99%) rename test/lua-Harness-tests/{411-luajit.t.disabled => 411-luajit.t} (99%) create mode 100644 test/lua-Harness-tests/profile_tarantool.lua diff --git a/test/lua-Harness-tests/241-standalone.t.disabled b/test/lua-Harness-tests/241-standalone.t similarity index 99% rename from test/lua-Harness-tests/241-standalone.t.disabled rename to test/lua-Harness-tests/241-standalone.t index 47c50a6b..57d9e5bd 100755 --- a/test/lua-Harness-tests/241-standalone.t.disabled +++ b/test/lua-Harness-tests/241-standalone.t @@ -29,6 +29,11 @@ L --]] require'test_assertion' + +if _TARANTOOL then + skip_all("tarantool") +end + local has_bytecode = not ujit and not ravi local has_error52 = _VERSION >= 'Lua 5.2' local has_error53 = _VERSION >= 'Lua 5.3' diff --git a/test/lua-Harness-tests/320-stdin.t b/test/lua-Harness-tests/320-stdin.t index bff63760..f4de97fd 100755 --- a/test/lua-Harness-tests/320-stdin.t +++ b/test/lua-Harness-tests/320-stdin.t @@ -64,7 +64,7 @@ end ]] f:close() - local cmd = lua .. [[ -e "f = loadfile(); print(foo); f(); print(foo('ok'))" < foo-320.lua]] + local cmd = lua .. [[ -e "foo = nil; f = loadfile(); print(foo); f(); print(foo('ok'))" < foo-320.lua]] f = io.popen(cmd) equals(f:read'*l', 'nil', "function loadfile (stdin)") equals(f:read'*l', 'ok') diff --git a/test/lua-Harness-tests/411-luajit.t.disabled b/test/lua-Harness-tests/411-luajit.t similarity index 99% rename from test/lua-Harness-tests/411-luajit.t.disabled rename to test/lua-Harness-tests/411-luajit.t index 7830df4f..da1af9ce 100755 --- a/test/lua-Harness-tests/411-luajit.t.disabled +++ b/test/lua-Harness-tests/411-luajit.t @@ -27,7 +27,7 @@ See L require'test_assertion' local profile = require'profile' -if not jit or ujit then +if not jit or ujit or _TARANTOOL then skip_all("only with LuaJIT") end diff --git a/test/lua-Harness-tests/profile_tarantool.lua b/test/lua-Harness-tests/profile_tarantool.lua new file mode 100644 index 00000000..2abd37ff --- /dev/null +++ b/test/lua-Harness-tests/profile_tarantool.lua @@ -0,0 +1,63 @@ +--- +-- lua-Harness : +--- + +local profile = { + +--[[ compat 5.0 + has_string_gfind = true, + has_math_mod = true, +--]] + + compat51 = false, +--[[ + has_unpack = true, + has_package_loaders = true, + has_math_log10 = true, + has_loadstring = true, + has_table_maxn = true, + has_module = true, + has_package_seeall = true, +--]] + + compat52 = false, +--[[ + has_mathx = true, + has_bit32 = true, + has_metamethod_ipairs = true, +--]] + + compat53 = false, +--[[ + has_math_log10 = true, + has_mathx = true, + has_metamethod_ipairs = true, +--]] + +-- [[ luajit + luajit_compat52 = false, + openresty = false, +--]] + +} + +require'strict'.off() -- allows undeclared variables + +_G.utf8 = nil -- not compatible with the PUC one + +-- luacheck: globals _dofile +function _dofile (filename) + print("# Custom dofile") + return dofile(filename) +end + +package.loaded.profile = profile -- prevents loading of default profile + +return profile + +-- +-- Copyright (c) 2018-2021 Francois Perrad +-- +-- This library is licensed under the terms of the MIT/X11 license, +-- like Lua itself. +-- -- 2.32.0