lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.38k stars 184 forks source link

Can't install/run on Windows 10 #715

Open SauceChord opened 1 year ago

SauceChord commented 1 year ago

I'm having problems running busted on Windows 10. Built Lua 5.4 (5.4.4?). There exists a "busted" file, but I don't see how that's going to execute. Also there's this Error: unknown option '-e' that shows up in the output? In the bin directory there's only one file, busted

PS E:\repos-ext\busted> luarocks remove busted --force
Checking stability of dependencies in the absence of
busted scm-1...

Removing busted scm-1...
Removal successful.
PS E:\repos-ext\busted> luarocks make

busted scm-1 depends on lua >= 5.1 (5.4-1 provided by VM)
busted scm-1 depends on luasystem >= 0.2.0 (0.2.1-0 installed)
busted scm-1 depends on dkjson >= 2.1.0 (2.6-1 installed)
busted scm-1 depends on say >= 1.4-1 (1.4.1-3 installed)
busted scm-1 depends on luassert >= 1.9.0-1 (1.9.0-1 installed)
busted scm-1 depends on lua-term >= 0.1 (0.7-1 installed)
busted scm-1 depends on penlight >= 1.3.2 (1.13.1-1 installed)
busted scm-1 depends on mediator_lua >= 1.1.1 (1.1.2-0 installed)
Usage: luarocks [-h] [--version] [--dev] [--server <server>]
       [--only-server <server>] [--only-sources <url>]
       [--namespace <namespace>] [--lua-dir <prefix>]
       [--lua-version <ver>] [--tree <tree>] [--local] [--global]
       [--no-project] [--verbose] [--timeout <seconds>] [<command>]
       ...

Error: unknown option '-e'
Did you mean '-h'?
Usage: luarocks [-h] [--version] [--dev] [--server <server>]
       [--only-server <server>] [--only-sources <url>]
       [--namespace <namespace>] [--lua-dir <prefix>]
       [--lua-version <ver>] [--tree <tree>] [--local] [--global]
       [--no-project] [--verbose] [--timeout <seconds>] [<command>]
       ...

Error: unknown option '-e'
Did you mean '-h'?
busted scm-1 is now installed in C:\Users\SauceChord\AppData\Roaming/luarocks (license: MIT <http://opensource.org/licenses/MIT>)

PS E:\repos-ext\busted> busted spec
busted : The term 'busted' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ busted spec
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (busted:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Tieske commented 1 year ago

I think this is a LuaRocks problem. The -e flag is probably targetted at lua.exe and not at luarocks, since the latter doesn't know it.

Tieske commented 1 year ago

Could it be this issue; https://github.com/luarocks/luarocks/issues/1287 ?

SauceChord commented 1 year ago

I don't know but I got it solved by using scoop.sh to install luarocks and then install busted via luarocks thanks to another issue I found in their repo.

https://github.com/luarocks/luarocks/issues/1501

So the steps I did (plus I guess since before installing a compiler for building lua from source)