bluebird75 / luaunit

LuaUnit is a popular unit-testing framework for Lua, with an interface typical of xUnit libraries (Python unittest, Junit, NUnit, ...). It supports several output formats (Text, TAP, JUnit, ...) to be used directly or work with Continuous Integration platforms (Jenkins, Maven, ...).
Other
572 stars 137 forks source link

support for Lua 5.4 #137

Closed gennaro-tedesco closed 3 years ago

gennaro-tedesco commented 3 years ago

Description

luaunit fails to install for Lua 5.4

Configuration

$ lua -v
Lua 5.4.2  Copyright (C) 1994-2020 Lua.org, PUC-Rio

system: macOs Big Sur, version 11.1

Example

Running luarocks install luaunit throws the following:

Installing https://luarocks.org/luaunit-3.3-1.src.rock
Missing dependencies for luaunit 3.3-1:
   lua < 5.4 (not installed)

luaunit 3.3-1 depends on lua >= 5.1 (5.4-1 provided by VM)
luaunit 3.3-1 depends on lua < 5.4 (not installed)

Error: Could not satisfy dependency lua < 5.4: Rock lua 5.4-1 is already provided by VM or via 'rocks_provided' in the config file.

Is luaunit unsupported for the latest versions of Lua or am I installing it wrong?

YodaEmbedding commented 3 years ago

Notice that you have lua 5.4 but luaunit requires < 5.4. The current git version appears to allow < 5.5 -- see https://github.com/bluebird75/luaunit/commit/67da65d8b4d100a4c0762b13c10cb8bb90f0995a -- but this hasn't been released yet.

For now, you can install to 5.3 instead:

luarocks install luaunit --lua-version 5.3

In order to use it, you will need to change your lua paths to use Lua 5.3. This can be done by:

eval `luarocks path --lua-version 5.3`

That merely runs a couple of export commands to update the environment variables, so it should only last as long as your terminal instance does.

bluebird75 commented 3 years ago

Version 3.4 of LuaUnit has now been released, with support for Lua 5.4 . You can install/upgrade it with luarocks.

Thanks for creating the incentive of doing it !

gennaro-tedesco commented 3 years ago

I confirm it installs fine

luarocks install luaunit
Installing https://luarocks.org/luaunit-3.4-1.rockspec

luaunit 3.4-1 depends on lua >= 5.1 (5.4-1 provided by VM)
luaunit 3.4-1 depends on lua < 5.5 (5.4-1 provided by VM)
luaunit 3.4-1 is now installed in /usr/local (license: BSD)

I have not checked yet by writing unit test code (but I suspect it should work fine too).

bluebird75 commented 3 years ago

I would be surprised if it would not work fine but don't hesitate to report it if that's the case!