luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

Tests for coro- libraries #202

Closed squeek502 closed 5 years ago

squeek502 commented 7 years ago

Related to https://github.com/luvit/lit/issues/200#issuecomment-276886799

This is a very quick and dirty first attempt at adding a test runner for the coro- lit deps. I used the tap.lua from luver and included a tests/main.lua that will load a script and run it. The implementation is more for discussion than anything, as I'm extremely unconfident in what I was able to come up with.

The tests have to be run in a slightly weird way in order to get all the paths to match up. luvi has to be in the lit root directory, and then you can run the following:

luvi tests -- tests/run.lua

I'm also not really sure how to deal with unclosed handles, so I just manually closed the saved connection in my test case, but I'm not sure that if that's what should be done.

creationix commented 7 years ago

This is great, thanks for starting this.

Lit has some tests currently, but they only work for me since they depend on my private github ssh keys.

squeek502 commented 5 years ago

Thinking of merging this to try to get the ball rolling. Still open to better ideas for how to implement a test runner if anyone has them, though.