2
votes

So I have some simple unit tests setup in busted. I am a little new to LUA, so I may be missing something obvious.

When I run:

lua test.lua

I get expected results (7 succeed, 1 failed on purpose to try out busted) in the nice terminal output.

My ultimate goal however is to output JSON results, and have a script that consumes JSON from multiple tests to make some summary pages for my fellow WoW addon developers.

When I run:

lua test.lua -o json

my terminal pauses for a brief second, and I am returned to the command line.

There is no terminal output, nor is any file created.

I am relatively new to lua and busted in general, could you provide me any pointers?

Here is a screenshot:

enter image description here

And here is a link to Busted's website.

1
Apparently, latest Busted version fails producing JSON output of some tests with error code 1. Must try digging deeper... - Kamiccolo
Also, could You please clarify Lua and Busted versions You're using? - Kamiccolo
Does lua -o json test.lua work by any chance? - Etan Reisner
@Kamiccolo LUA version - 5.1.5 Busted version - 2.0.rc10-0 - Brandon
@EtanReisner That gives me a lua error as it doesn't recognize the -o option. I tried busted -o json test.lua. It ran, but produced no output just like my original post. - Brandon

1 Answers

3
votes

The issue in question was caused by dkjson module not using functions in tables properly. The bug was fixed in pull request #449, so, You should wait for the fix to get to next release candidate (>2.0.rc10-0) of Busted or just download and build recent version from here. Btw, relevant bug report - #448.