luaposix
luaposix copied to clipboard
socket test script
I'd have to look into the details, but my guess is that this stuff is hard to test as a standalone unit. To be able to test IPv6 the host should have IPv6 connectivity configured and enabled, and should allow the tests to bind ports and connect to the outside world. Not sure if this is something which can be properly tested with something like Travis...
Thanks for the swift response! :)
I think its more to do with whether the luaposix socket calls provide everything needed to check whether the functionality required is available before trying to run an unsupported test. This is surely possible with C, so if it can't (yet) be done with luaposix from the Lua side, then I see no technical reason why it can't be fixed by exposing the APIs that C would use to make the pre-test checks.
Plainly, Mac OS has perfectly functional sockets, and most Linux software compiles on the Mac with very little patching (ref. Homebrew). If I need to add a skip function to Specl for gracefully exiting tests that are discovered to be incompatible in the pre-test phase, it would be quite a quick feature to implement.
I sometimes hear the term: a simple matter of programming ;-)
Actually, an explicit skip function is not required in recent Specl, because it only reports on examples that fire expect commands. Conditionally running an example is as simple as this:
- describe ipv6 only functionality:
if posix.IPPROTO_IPV6 then
expect (ipv6 stuff).to_contain (ipv6 only results)
end
And reporting will automatically elide that test case if the expect is not reached.
The test for this issue started passing unexpectedly for me, since I merged today's commits.
It passes unexpectedly for me on my dev machines, but fails on Travis (Ubuntu Precise?) last I checked.
See https://travis-ci.org/luaposix/luaposix/jobs/51387861 : one appears to be passing, but not the other (unless I am misreading the log).