From: Maarten B. <sou...@ds...> - 2013-06-09 17:08:05
|
> On 09. 06. 2013 12:15, Maarten Brock wrote: > >> On 09. 06. 2013 11:06, Maarten Brock wrote: > >>> And also, please, use ASSERT(cond) or ASSERTFALSE(cond) instead of 'if > >>> (cond) ASSERT(0)' > >>> in the regression tests. Counting the tests performed is part of the > >>> ASSERT macro and it > >>> is really annoying to see so many regression tests that report that > >>> nothing was tested. > >>> When asked, I would vote to delete all these tests as they appear to be > >>> useless. > >> Sometimes such test are useful: test if the code can be compiled, > >> without testing the generated code. Exampe: testing the preprocessor, > >> pragmas, ... So we should be careful when removing empty tests. > >> > >> Borut > > Yes, I know. But even then I would advise to insert an ASSERT(1) to > > indicate something was tested. In the same line the regression test > > suite issues a warning if there is no testXXXX function in the test > > source file. > > I agree. > > > The other option is of course to remove the counting of performed > > tests. But the current state is useless as over 50% of the tests is > > not counted. Your votes please. > > So, if I understand you correctly, you are talking about tests having > testXXXX function(s) without any asserts? > If this is the case, then they should be reviewed and ASSERTs should be > added if / where appropriate. If the tests are not test anything useful, > then of course they should be removed. They just eat precious resources > on snapshot build machines: (cpu cycles per useless tests * nuber of > targets * number of regression test hosts). > > Borut Practically all GCC regression tests claim that nothing was tested. This is because they use: if (something_went_wrong) ASSERT(0); And thus they never count the test when things go right. I actually don't mind if some files report no test was performed if that really is the case (e.g. for some target). But the current report says: I tested almost nothing but the little I did test went ok. And on top of that, when a test does fail, it now reports that it fails because of '0' and not because 'x != 10'. I've complained about this already when the first GCC tests were added, but nowadays there are more GCC tests than native SDCC tests in the suite. Maarten |