News for hackers. Stuff that matters.
Re:Greatest: C unit testing library in one file by gcb0 on Wednesday January 08, 2014 @01:12AM (#7022013)
this is a bloated minunit :)

just the short of thing a QA dev would do to keep his job.

i kid. kid. It is nice, but overkill in my humble opinion. Failing on the first error for unittest is a feature. because you are not supposed to even commit it if it is failing, so no need to fancy graphics and reports. It either passed, or not.

Re:Greatest: C unit testing library in one file by exDM69 on Wednesday January 08, 2014 @03:21AM (#7022379)
> Failing on the first error for unittest is a feature. because you are not supposed to even commit it if it is failing, so no need to fancy graphics and reports.

A test suite may run for a long time and bailing out at first failure is a very stupid thing to do. It may be nice to have it as an option but not the only way of doing it.

Even a humble test suite might take 5 minutes to run, going to grab some coffee and coming back to see the first test fail would be a bad thing. A big test suite might take hours on a CI server, having it fail on the first test would be a major waste of time.

And with a modern distributed version control, there's no reason why you shouldn't commit code (not to the master branch!) that doesn't pass tests. To share it with your team mates or push the code to be tested on a CI server, for example.

Re:Greatest: C unit testing library in one file by gcb0 on Thursday January 09, 2014 @12:55PM (#7031969)
if you unit tests take that long, break it up.

or you are probably doing functional testing in your units.

Re:Greatest: C unit testing library in one file by diab0lic on Wednesday January 08, 2014 @01:30AM (#7022071)
Is it though? If I made changes that broke something surely I would want to know everything that broke rather than just the first test in an arbitrarily ordered set of tests!

Though I like your style, very simple, and simple is good. The state is binary, tests are passing or they are not. Unfortunately in this particular reality the added complexity of knowing all broken tests can prove very useful.

Re:Greatest: C unit testing library in one file by silentbicycle on Wednesday January 08, 2014 @01:35AM (#7022090)
Knowing that a change broke a specific set of tests tells you a lot more than knowing it broke the first one of them that happened to run.

If I'm using fuzzing to run thousands of tests, and all the ones whose seed led to the same specific bit pattern are failing, that's particularly useful information. I found a particularly subtle bug in heatshrink (https://github.com/atomicobject/heatshrink) that way, but a single failing test would have looked like noise.

Re:Greatest: C unit testing library in one file by kabouseng on Wednesday January 08, 2014 @02:55AM (#7022307)
I'd like at least the option to keep on working, making changes, and at the end fix all the broken tests. Sometimes it's easier to develop this way than to stop everytime and fix a broken test, usually when you change the architecture / big code changes.
Re:Greatest: C unit testing library in one file by swah on Wednesday January 08, 2014 @10:03AM (#7023860)
Also consider that in embedded software the hardware changes much more. You can't just "not commit something that fails". Something might work on hardware v1 but fail on v2 (that uses the cheaper version of the microcontroller, whatever).
Re:Greatest: C unit testing library in one file by yxhuvud on Wednesday January 08, 2014 @06:39AM (#7022904)
Failing on the first error is not a feature, because the error that happen to be first may not give enough information on where it went wrong, but a different test may.