Files
qt-creator/share/qtcreator/lua-plugins/luatests/qtctest.lua
Eike Ziller f5dde31558 Move the shipped Lua plugins to the resources directory
On macOS, files in Contents/PlugIns/ need to be codesigned individually.
Since Lua plugins are not really binaries, per Apple's documentation
that is to be avoided (and we currently only sign executables there).

Just move Lua plugins generally to the resources directory, like we do
for other scripts like the debugger Python scripts, and load them from
there.

Change-Id: Idabd6b7c0c7c6e842b1752488cb7073f00e7be49
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-20 07:40:46 +00:00

33 lines
954 B
Lua

-- Copyright (C) 2024 The Qt Company Ltd.
-- SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
local inspect = require('inspect')
local function traceback()
local result = ""
local level = 1
while true do
local info = debug.getinfo(level, "Sl")
if not info then break end
if info.what ~= "C" then
---Get the last part of the path in info.source
local fileName = info.source:match("^.+/(.+)$")
result = result .. (string.format(" %s:%d\n", fileName, info.currentline))
end
level = level + 1
end
return result
end
local function compare(actual, expected)
if (actual == expected) then
return true
end
error("Compared values were not the same.\n Actual: " ..
inspect(actual) .. "\n Expected: " .. inspect(expected) .. "\nTrace:\n" .. traceback())
end
return {
compare = compare,
}