diff --git a/README.md b/README.md index 9ebfd61..710b6d4 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,34 @@ Test ==== You will need `busted` package to be installed locally (to `lua_modules` directory). To install it -using Luarocks call `luarocks install --tree=lua_modules busted`. You might also want to install +using Luarocks call `luarocks --lua-version 5.2 install --tree=lua_modules busted`. You might also want to install `luacov` to get the coverage information. After installing call `test.bat` from repo root and watch tests passing. That's it. + +### Getting `tests` to run on Windows + +> [!IMPORTANT] +> Clink and clink-completions use Lua **5.2**; be sure to download Lua 5.2 (not 5.4 or other versions). + +**Prerequisites:** + +1. Make a local luabin directory, for example `c:\luabin`. +2. `set PATH=%PATH%;c:\luabin` to add your luabin directory to the system PATH. +3. Install Lua 5.2 executables from [LuaBinaries](https://luabinaries.sourceforge.net/download.html) to your luabin directory. +4. Download Lua 5.2 sources zip from [LuaBinaries](https://luabinaries.sourceforge.net/download.html), and extract the headers from its `include` subdirectory into `include\lua\5.2` under your luabin directory. +5. Install [MinGW](https://sourceforge.net/projects/mingw/), which is needed because the luasystem luarock wants to build itself from scratch. +6. Download [luacheck](https://github.com/lunarmodules/luacheck/releases) into your luabin directory. +7. Download the [luarocks](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows) executable files into your luabin directory. +8. `luarocks --local config variables.lua c:\luabin\lua52.exe` to tell luarocks where to find your Lua binaries. +9. `luarocks --lua-version 5.2 install busted` to install busted. +10. `luarocks --lua-version 5.2 install luacov` to install luacov. +11. `set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\luarocks\bin` to add the luarocks bin directory to the system PATH, so that `busted` can be found and executed. + +That should get everything set up. + +**Running `tests`:** + +Make sure the PATH has your luabin directory and the luarocks bin directory (from steps 2 and 11 in the prerequisites above). + +Then run `tests` from the clink-completions repo root.