Trace: » lua02.html

[hemmerling] Lua & eLua 2/3

Tools

IDEs & Debuggers

IDEs & Debuggers, some of them suggested by CoreGames

Atom for CORE
Eclipse with LuaEclipse ( no CORE support )
IntelliJ IDEA with EmmyLua ( no CORE support )
NetBeans 8.0 & NetBeans 7.4 with "Lua Glider NetBeans Edition" ( no CORE support )
Notepad++ for CORE
The complete Windows solution ( Visual Studio Code & Luacheck & .luacheckrc ) for CORE

Cross-development on Windows and Linux ( Visual Studio Code & Debugger & Luacheck & .luacheckrc )

.vscode
  • The directory ”.vscode” is created in the working directory of VSC. It may contain “launch.json” and “tasks.json”.
  • The reason for the VSC error message “You don´t have an extension for debugging Lua. Should we find a Lua extension in the Marketplace?” is mostly, that there is no “lauch.json” yet ( generated ).
  • My experience: If you change the debugger, or even change the script to be debugged, best is to start with frech “launch.json” file...
Possible Attributes of "launch.json"
Tom Blind "Local Lua Debugger"
    • Operation:
      • “To customize Run and Debug, create a launch.json file” ⇒ 3 JSON debugging configurations are created automatically: “Debug Lua Interpreter (Scripts)”, “Debug Custom Lua Environement (Scripts)”, “Debug Current File”.
      • For successful step-by-step debugging ( “Start Debugging” ), you must set a RED breakpoint at the first non-comment line - both on VSC/Linux and VSC/Windows -. The Lua debugger halts, you may then move further step-by-step or run :-). Without a manual breaktpoint, the script is executed without debugging :-(.
      • OR you insert into your LUA script code, to start the LUA debugger manually:
        require("lldebugger").start()
        
    • The statement “os.exit()” is processed properly :-).
    • The statement “print(package.path)” prints the contents of the environment variable LUA_PATH, plus some more string contents :-) ⇒ See below.
actboy168 "Lua Debug"
    • Operation:
      • “To customize Run and Debug, create a launch.json file” ⇒ 2 JSON debugging configurations are created automatically:
        • For Windows: “Debug (Scripts)”, “Debug Current File”.
        • For Linux: “Debug”, “Debug Current File”.
      • The statement “os.exit()” is not processed properly, both on Windows and Linux, by the will of the author of the plugin :-(.
        • Version 1.40.0 does not work properly in “Run Without Debugging” mode :-(: No debug console output :-(.
        • Version 1.40.0 works properly in “Start Debugging” mode, just if in the step mode. If :-(: If the button “Continue(F5)” is pressed, i.e. the debugger turns into “Run Without Debugging” mode, all debug console output is supressed :-(.
        • The software author suggests to use
          os.exit(0, true).
          
      • The statement “print(package.path)” doesn't print the contents of the environment variable LUA_PATH.
        • For the JSON debugging configuration “Debug (Scripts)”, there is a fix ⇒ See below.
        • For the JSON debugging configuration “Debug Current File”, the fix does not work.
      • On Debian Linux 10.7, LuaDebug 1.40.0 fails by the error message
        error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
        
        • Fix for Debian Linux 10.7:
          $whereis libreadline.so.7.0
          libreadline.so.7: /usr/lib/x86_64-linux-gnu/libreadline.so.7.0 /usr/lib/x86_64-linux-gnu/libreadline.so.7
          $cd /lib/x86_64-linux-gnu/
          $sudo ln -s libreadline.so.7.0 libreadline.so.6
          
Ravi Programming Language "Lua and Ravi 5.3 Debugger"
    • Operation on Windows:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “Ravi Debugger”.
        • On Windows, the debugger doesn't handle Spaces ( ” ” ) in the path of “${workspaceRoot}”, properly :-(. Example: “${workspaceRoot}” = “C:/Users/<user>/Documents/My Games/CORE/Saved/Maps/test/Data/Scripts/”. The debugger aborts by the error message: :-(:
          Failed to launch C:/Users/<user>/Documents/My due to error: cannot open C:/Users/<user>/Documents/My: No such file or directory
        • Modify “launch.json”:
          • '“program”: “${workspaceRoot}/main.lua arg1 arg2”' ⇒ '“program”: “main.lua”,'.
          • '“LUA_PATH”: “${workspaceRoot}/?.lua”,' ⇒ '“LUA_PATH”: “${env:LUA_PATH}”,' or delete this JSON line.
          • '“LUA_CPATH”: “${workspaceRoot}/?.dll”' ⇒ '“LUA_CPATH”: “${env:LUA_CPATH}”' or delete this JSON line.
      • Breakpoints can´t be set, in the editor :-(.
      • The statement “os.exit()” is processed properly :-).
      • The statement “print(package.path)” prints the contents of the environment variable LUA_PATH, plus some more string contents :-).
    • Operation on Linux:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “Ravi Debugger”.
      • “Run / Start Debugging” or “Run / Run Without Debugging” - Debugging aborts without notice, immediately :-(.
Tangzx "EmmyLua"
    • Not suitable for LUA@CORE :-(.
    • Operation:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “LuaHelper: Debug”.
      • “Run / Start Debugging” or “Run / Run Without Debugging”
      • Solution: Add this code to your project, use the 32-bit EmmyLua DLL path for Windows 64-bit:
        if (package.config:sub(1,1) == "\\")
        then 
            -- "C:\Users\<user>", with CMD => %homedrive%%homepath%, with PowerShell => $home
            --package.cpath = package.cpath .. "C:\\Users\\Administrator\\.vscode\\extensions\\tangzx.emmylua-0.3.49\\debugger\\emmy\\windows\\x64\\?.dll"
            package.cpath = package.cpath .. "C:\\Users\\Administrator\\.vscode\\extensions\\tangzx.emmylua-0.3.49\\debugger\\emmy\\windows\\x86\\?.dll"
        else
            package.cpath = package.cpath .. "~/.vscode/extensions/tangzx.emmylua-0.3.49/debugger/emmy/linux/emmy_core.so"
        end
        local dbg = require("emmy_core")
        dbg.tcpListen("localhost", 9966)
        
      • “Run / Start Debugging” or “Run / Run Without Debugging” is denied on Windows, if there is no Java8 runtime / Java8 SDK - or newer -, by the VSC error message :-(. My installation of JDK 11 works fine :-):
        Can´t find Java! Please install Java 1.8 or above and set JAVA_HOME environment variable. Source: EmmyLua (Extension)
  • Did not yet work for me neither on Windows nor on Linux :-(.
devCAT "Lua Debugger"
BeamNG "Lua/LuaJIT Debugger"
yinfei "Lua Helper"
  • Visual Studio Marketplace, yinfei "Lua Helper" - “Debug Attach, Debug Single Lua File, Run Single Lua File,...”.
    • Operation:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “LuaHelper: Debug”.
      • “Run / Start Debugging” or “Run / Run Without Debugging” - Debugging aborts without notice, immediately :-(.
  • Did not yet work for me neither on Windows nor on Linux :-(.
Alex D. "Lua Debug"
    • Operation on Windows:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “Lua Debug”.
      • “Run / Start Debugging” or “Run / Run Without Debugging” - Debugging aborts without notice, immediately :-(.
    • Operation on Linux:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “Lua Debug”.
      • Debugger starts, error message during debugging:
        stdin:1: syntax error near '1'
  • Did not yet work for me neither on Windows nor on Linux :-(.
qing wang "LuaPanda"
leafvmaple "Lua Debugger"
    • GitHub "leafvmaple / vscode-zlua" - Source code not available :-(.
    • Operation:
      • “To customize Run and Debug, create a launch.json file” ⇒ Select “Lua Debug”.
        • On Windows, “Run / Start Debugging” or “Run / Run Without Debugging” causes the VSC error message:
          TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received
          undefined
          at validate String internal/validators.js:124:11)
          at Object.normalize (path.js 266:5
          at c.launchRequest
          (c\Users\Administrator.vscode extensions\leafvmaple.vscode-zlua-01.5\dist adapte .2243)
          at c.dispatchRequest
          (c\Users\Administrator\.vscode extensions\leafvmaple vscode-ziua-0.15\dist adiant..25278)
          at cdispatchRequest
          (c\Users\Administrator.vscode extensions leafvmaple vscode-ziua-0.15\dist adapt.14030
          at chandleMessage
          (C\Users\Administrator.vscode extensions leafvmaple.vscode ziua-0.15\distaciant.-10957)
          at c_handleData
          (c\Users\Administrator. vscode extensions leaf maple scodela-0.75\dist adiant....12621
          at Socket <anonymous
          (c\Users\Administrator vscode extensions leaf maplenscode-0.15\dist adapt.11330D)
          at Socket.emit (events.js 315:20
          at addChunk (internal streams readable is 309:12)
          
        • On Linux, “Run / Start Debugging” or “Run / Run Without Debugging” causes the VSC error message:
          TypeError (ERR_INVALID ARG_TYPE]: The "path" argument must be of type
          string. Received undefined
          at validateString (internal/validators.js:124:11)
          at Object normalize (path.js:1005:5)
          at c.launchRequest (/home/node/.vscode/extensions/leafvmaple.vscode-
          zlua-0.1.5/dist/adapter.js:1:2248)
          atc
          dispatchRequest (/home/node8/.vscode/extensions/leafvmaple.vscode
          zlua 0.1.5/dist/adapter.js:1:25278)
          at c.dispatchRequest (/home/node/.vscode/extensions/leafvmaple.vscode
          zlua-0.1.5/dist/adapter.js:1:14630)
          at chandleMessage (/home/node/.vscode/extensions/leafvmaple vscode-
          zlua-0.1.5/dist/adapter.js:1:10967)
          atc. handleData (/home/node/vscode/extensions/leaf maple vscode-
          zlua 0.1.5/dist/adapter.js:1:12621)
          at Socket anonymous (/home/node/.vscode/extensions/leafvmaple vscode
          zlua 0.1.5/dist/adapter.js:1:11300)
          at Socket emit (events.js:315:20)
          at addChunk (internal/streams/readable.js:309:12)
          CALL STACK
          
  • Did not yet work for me neither on Windows nor on Linux :-(.
wellshsu "luaide-lite"
  • Operation on Windows and Linux:
    • “To customize Run and Debug, create a launch.json file” ⇒ Select “LuaDebug”. 5 JSON debugging configurations are generated: “Unity-Remote (Scripts)”, “Cocos-Remote (Scripts)”, “Cocos-Launch (Scripts)”, “Lua51-Launch (Scripts)”, “Debug Current File”.
    • On Windows, the debugger starts by “LuaDebug Server is listening at 7003”, but then the debugger aborts by the error messsage:
      c:\Users\<user>\.vscode\extensions\wellshsu.luaide-lite-0.2.3\res\debug\win32\lua: (command line):1: module 'LuaDebug' not found:
      
    • On Linux, the debugger starts by “LuaDebug Server is listening at 7003” but hangs immediately, just the symbols “Pause”, “Restart” and “Stop” are active.
  • Did not yet work for me neither on Windows nor on Linux :-(.
mayishidai "luaide-lite-up"
  • Operation on Windows and Linux:
    • “To customize Run and Debug, create a launch.json file” ⇒ Select “LuaDebug”. 5 JSON debugging configurations are generated: “Unity-Remote (Scripts)”, “Cocos-Remote (Scripts)”, “Cocos-Launch (Scripts)”, “Lua51-Launch (Scripts)”, “Debug Current File”.
    • On Windows, the debugger starts by “LuaDebug Server is listening at 7003”, but then the debugger aborts by the error messsage:
      c:\Users\<user>\.vscode\extensions\wellshsu.luaide-lite-0.2.3\res\debug\win32\lua: (command line):1: module 'LuaDebug' not found:
      
    • On Linux, the debugger starts by “LuaDebug Server is listening at 7003” but hangs immediately, just the symbols “Pause”, “Restart” and “Stop” are active.
  • Did not yet work for me neither on Windows nor on Linux :-(.
kangping "luaide"
  • Operation on Windows and Linux:
    • “To customize Run and Debug, create a launch.json file” ⇒ Select “LuaDebug”. 8 JSON debugging configurations are generated: “Cocos2-Launch (Scripts)”, “COCOS(remote debugging) (Scripts)”, “Unity-ulua (Scripts)”, “Unity-slua (Scripts)”, “Unity-xlua (Scripts)”, “OpenResty (Scripts)”, “LuaTest (Scripts)”, “Debug Current File”.
      • Error message
        Configuration 'Debug Current File' is missing in 'launch.json'.
  • The debugger starts, but due to some pop-up messages and input windows in chinese language, I did not manage to operate it.
  • Did not yet work for me neither on Windows nor on Linux :-(.
OpenLuat Wendal Chen "LuatOS Debug"
OpenLuat colin "Skynet Debugger"
OpenLuat murru "tadpole Debugger"
"Test Explorer UI"
  • “Test Explorer UI” ⇒ See on this page.
  • Depends on “Lua Debug” :-(.
Proper Setting in the VSC "settings.json" File
  • My data for Windows “C:\Users\<user>\AppData\Roaming\Code\User\settings.json”:
    {
        "LuaCoderAssist.luacheck.configFilePath": "C:\\Users\\Administrator\\Documents\\My Games\\CORE\\Saved\\Maps",
        "LuaCoderAssist.luacheck.execPath": "C:\\int\\w64\\develop\\lua",
        "LuaCoderAssist.luaparse.luaversion": 5.3,
        "lua.targetVersion": "5.3",
        "lua.luacheckPath": "C:\\int\\w64\\develop\\lua\\luacheck.bat",
        "lua.debug.settings.luaVersion": "5.3",
        "lua-local.interpreter": "lua"
    }
    
  • My data for Linux ”~/.config/Code/User/settings.json” = ”/home/<user>/.config/Code/User/settings.json”:
    {
        "LuaCoderAssist.luacheck.configFilePath": "~/lua",
        "LuaCoderAssist.luacheck.execPath": "/usr/bin/",
        "LuaCoderAssist.luaparse.luaversion": 5.3,
        "lua.targetVersion": "5.3",
        "lua.luacheckPath": "/usr/bin/luacheck"
        "lua.debug.settings.luaVersion": "5.3",
        "lua-local.interpreter": "lua"
    }
    
Resources

Some other IDEs & Debuggers

Decompiler

Documentation Generator

EXE Generator

Luacheck - The #1 Linter

Luacheck

Resources

  • “A tool for linting and static analysis of Lua code”.
  • Experts told me that it is “the” #1 Lint tool for Lua :-).
  • Please install the 32-bit binaries ( for compatibility with MinGW 6.3 ).
  • Installation instructions: Install: “copy 'luacheck.exe' to a folder and add it to your PATH environment variable”.
  • GitMemory "module 'lfs' not found " - “I assumed that installing luacheck via luarocks installs lfs but I just checked and it doesn't. that was why I assumed it would work”.

Make

Obfuscators

Tools

Free online Services

Resources

Packet Manager

LuaDist

LuaRocks

LuaRocks on Windows
    • Suggestion to append some data to the environment settings for LuaRocks.
    • LuaDist, LuaRocks, MinGW, LuaSocket, ZeroBrane studio,...
    • Suggestion to append some data to the environment settings for LuaRocks ( of 2013, for Lua 5.2 on Win7 & Win8 ).
  • StackOverflow "How to set require in vscode Lua settings.json" - Suggestion to add a path to the Lua script variable “package.path” to name the location of Lua files created by LuaRocks when installing packages by LuaRocks.
  • My proper settings for Lua 5.3 on Win10:
    PATH =
    C:\Program Files (x86)\LuaRocks;
    LUA_PATH = 
    ./;
    .\?\init.lua;
    C:\Users\<user>\AppData\Roaming\luarocks\share\lua\5.3\?.lua;
    C:\Users\<user>\AppData\Roaming\luarocks\share\lua\5.3\?\init.lua;
    .\?.lua;
    LUA_CPATH =
    .\?.dll;C:\Users\<user>\AppData\Roaming\luarocks\lib\lua\5.3\?.dll
    
  • When running Lua Scripts by Powershell & CMD on Windows:
    • A Lua script executing “print(package.path)” prints the contents of the environment string variable “LUA_PATH” as stderr output on a Powershell or CMD console:
      ./;.\?.lua;.\?\init.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?\init.lua;
      
    • Executing Lua scripts with “require()” statements works fine, both for local Lua modules and for Lua modules installed by LuaRocks.
  • When executing Lua Scripts in VisualStudio Code on Windows, by the VSC plugin “Local Lua Debugger”:
    • A Lua script executing “print(package.path)” prints the contents of the environment string variable “LUA_PATH” and additional “c:\Users\Administrator\.vscode\extensions\tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua” as output on the VSC Debug console:
      ./;.\?.lua;.\?\init.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?\init.lua;c:\Users\Administrator\.vscode\extensions\tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua
      
  • When executing Lua Scripts in VisualStudio Code on Windows, by the VSC plugin “Lua Debug”:
    • A Lua script executing “print(package.path)” prints as output on the VSC Debug console :-(, e.g.:
      C:\Users\<user>\WorkingDirectory/?.lua
      
    • A Lua script executed in VisualStudio Code on Windows, by the VSC plugin “Lua Debug”, processes “require()” statements properly for local Lua modules not installed by LuaRocks.
    • A Lua script executed in VisualStudio Code on Windows, by the VSC plugin “Lua Debug”, may process “require()” statements for Lua modules installed by LuaRocks, if the string contents of the environment variable “LUA_PATH” ( or relevant part of it ) are added to the global Lua variable “package.path”:
      package.path = package.path .. ";C:\\Users\\<user>\\AppData\\Roaming\\luarocks\\share\\lua\\5.3\\?.lua;"
      lu = require("luaunit")
    • GitHub "actboy168 / lua-debug" Issue "print(package.path) != %LUA_PATH% ( 1.38.0 on Win10, 64bit ) #136" - Suggested workaround “Add path in launch.json, it can specify package.path”.
      • So You may either add the missing LUA_PATH - this solution works both for Windows and Linux ! -:
        • By the VSC Extension Settings for “Lua Debug” ( recommended! )
          Lua > Debug > Settings: Path
          Search path for Lua programs
          
          ${env:LUA_PATH}
          
        • Or by modifying “launch.json”. My “launch.json” file adds the missing LUA_PATH to “package.path”:
          {
              // Use IntelliSense to learn about possible attributes.
              // Hover to view descriptions of existing attributes.
              // For more information, visit: [[http://go.microsoft.com/fwlink/?linkid=830387|http://go.microsoft.com/fwlink/?linkid=830387]]
              "version": "0.2.0",
              "configurations": [
                  {
                      "type": "lua",
                      "request": "launch",
                      "name": "Debug",
                      "program": "${workspaceFolder}/run_my_first_module.lua",
                      "path": "${env:LUA_PATH}"
                  }
              ]
          }
          
  • LuaRocks configuration message on my Windows10 computer:
     Configuration files:
          System  : C:/Program Files (x86)/luarocks/config-5.3.lua (not found)
          User    : C:/Users/<user>/AppData/Roaming/luarocks/config-5.3.lua
          (not found)
          Project : C:\Users\<user>\Documents\My Games\CORE\Saved\Maps\<COREproject>\Data\Scripts/./.luarocks/config-5.3.lua
          (ok)
    
       Rocks trees in use:
          C:\Users\<user>\Documents\My Games\CORE\Saved\Maps\<COREproject>\Data\Scripts/./lua_modules
          ("project")
          C:\Users\<user>\AppData\Roaming/luarocks ("user")
    
  • “luarocks init”.
LuaRocks on Linux
    • “Search for a library with Luarocks”.
    • “Install a library with Luarocks”.
      • “Your default tree when installing libraries locally is $HOME/.luarocks, but you can redefine it arbitrarily”.
  • GitHub "luarocks/luarocks" Issues "Linux PATH for lua rocks #342".
    export LUA_PATH='/home/stefan/.luarocks/share/lua/5.3/?.lua;/home/stefan/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua'
    export LUA_CPATH='/home/stefan/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so'
    • “Under Linux a typical LUA_PATH contains entries like these: '/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;./?.lua;'[...]and many more... A file that from the perspective of the LUA_PATH can be found under 'exasolvs/query_renderer.lua' is treated by Lua as if you named it 'exasolvs.query_renderer'... Lua remembers which packages are loaded in 'package.loaded' ”.
  • StackExchange "Using a lua rock installed with luarock", 2012 - List of pathes where Lua looks for .Lua files, and so installed LuaRocks packages.
  • My proper settings for Lua 5.3 on Linux, in ”/etc/profile”:
    LUA_PATH='~/.luarocks/share/lua/5.3/?.lua;~/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua'
    LUA_CPATH='~/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so'
    export LUA_PATH
    export LUA_CPATH
    
  • When running Lua Scripts by Bourne shell on Debian Linux:
    • A Lua script executing “print(package.path)” prints the contents of the environment string variable “LUA_PATH” as stderr output on a Powershell or CMD console:
      ~/.luarocks/share/lua/5.3/?.lua;~/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua
      
  • When running Lua Scripts in VisualStudio Code on Debian Linux, by the VSC plugin “Local Lua Debugger”:
    • A Lua script executing “print(package.path)” prints the contents of the environment string variable “LUA_PATH” and additional ”/home/node8/.vscode/extensions/tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua” as output on the VSC Debug console:
      ~/.luarocks/share/lua/5.3/?.lua;~/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua;/home/node8/.vscode/extensions/tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua
      
  • LuaRocks configuration message on my Debian Linux computer:
    module 'luarocks.cfg' not found:
    no field package.preload['luarocks.cfg']
    no file '~/.luarocks/share/lua/5.3/luarocks/cfg.lua'
    no file '~/.luarocks/share/lua/5.3/luarocks/cfg/init.lua'
    no file '/usr/local/share/lua/5.3/luarocks/cfg.lua'
    no file '/usr/local/share/lua/5.3/luarocks/cfg/init.lua'
    no file '/usr/local/lib/lua/5.3/luarocks/cfg.lua'
    no file '/usr/local/lib/lua/5.3/luarocks/cfg/init.lua'
    no file './luarocks/cfg.lua'
    no file './luarocks/cfg/init.lua'
    no file '~/.luarocks/lib/lua/5.3/luarocks/cfg.so'
    no file '/usr/local/lib/lua/5.3/luarocks/cfg.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './luarocks/cfg.so'
    no file '~/.luarocks/lib/lua/5.3/luarocks.so'
    no file '/usr/local/lib/lua/5.3/luarocks.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './luarocks.so'
    
  • Where does LuaRocks install packages ( e.g. “luaunit” ) on my Debian Linux computer?
    • Test files for LuaUnit:
      /usr/local/lib/luarocks/rocks/luaunit/3.4-1/test
      
    • LuaRocks as installed on Debian Linux 10.7 with Lua 5.3.3 by “sudo apt install luarocks”, puts the important start script file for a Lua package ( e.g. “sudo luarocks install luaunit” ⇒ file “luaunit.lua” ) into a “5.1” directory, instead in a “5.3” directory :-(.
      /usr/local/share/lua/5.1
      
    • To fix that, either you have to created a “5.3” directory and copy the “5.1” data into it, or to set a soft link, so that the installed code is available for Lua5.3 users:
      cd /usr/local/share/lua
      sudo ln -s ./5.1 ./5.3
      
      cd /usr/local/lib/lua
      sudo ln -s ./5.1 ./5.3
      
      
Resources

LuaFileSystem

Profiler

Testing, Unit Test

Unit Test Frameworks, Mocking, & Build-Test-Deploy Toolchains

BTDLua ( build-test-deploy Development Environment )
busted
Gambiarra
LuaDist
luaspec
  • GitHub "mirven / luaspec" - “A specification framework for lua”.
  • Lua-Users: “Behavior Driven Development (BDD) test framework”.
LuaUnit #
lunatest
  • GitHub "silentbicycle / lunatest" - “xUnit-style + randomized unit testing framework for Lua (and C projects using Lua, etc.). It's largely upwardly compatible from lunit, with some changes”.
lunit
lunitx
Lunity
  • GitHub "Phrogz / Lunity" - “Simple-but-rich unit testing for Lua”.
    • Lua-Users: ”(similar to lunit, but can only run a single file and doesn't distinguish between errors and test assertions)” :-(.
Jasper Lyons' 31-Lines UnitTest Frameworks
Mediawiki / Wikipedia
Minctest
mockagne
François Perrad
QhunUnitTest
Shake
  • “Shake is a simple and transparent test engine for Lua that assumes that tests only use standard assert and print calls. If you are looking for a xUnit style framework, check lunit and luaunit instead”.
  • Lua-Users: “using basic assert-like syntax”.
telescope
  • GitHub "norman / telescope" - “A highly customizable test library for Lua that allows declarative tests with nested contexts”.
  • Lua-Users: “A highly customizable test library for Lua that allows for declarative tests with nested contexts. Uses BDD-style spec names”.
Testy
  • GitHub "siffiejoe / lua-testy" - “Easy unit testing for Lua modules”.
  • Lua-Users: “Lua script for minimal unit testing on Lua 5.1/5.2/5.3 that collects test functions from local variables”.
u-test
  • GitHub "IUdalov / u-test" - “Sane and simple unit testing framework for Lua”.
  • Lua-Users: “complete unit-testing framework for lua 5.1/5.2/5.3, inspired by googletest. Has colourful command line interface”.

Test Explorer / Test Runner / Test Generator

Lua unit test generator" (LUTG)
Test Explorer UI #

Resources

Tracing

Resources

Appropriate OpenDirectory Directory Pages

 
en/lua02.html.txt · Last modified: 2021/09/25 12:06 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki