[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cybop-developers] UnitTests

From: Christian Heller
Subject: Re: [cybop-developers] UnitTests
Date: Tue, 07 Mar 2017 22:20:45 +0100
User-agent: KMail/4.14.1 (Linux/3.16.0-4-686-pae; KDE/4.14.2; i686; ; )

Hi Enrico,

> Here is an impression how it will look like. This is the context of the 
> produced log file. I added a test which will fail.
> I “converted” two existing test-classes in the proposed directory-structure.

this looks good.

> I used a small hack for having some kind of information if the assert is not 
> obviously enough. unfortunately the assert in c is quite restricted, but 
> maybe it will serve our purpose.
> Instead of using another framework, we could probably just provide some easy 
> to use assert methods.

O.k. I follow your advice.

> I understand your concern and resigned from using another framework. To be 
> honest, the c unittest frameworks are just convenient due to the assert 
> methods they offer. But to create suites and tests we can use CTest, which 
> seems to make a lot of things possible already. I really like the CTest. 
> Impressive framework.

O.k. Then go ahead with CTest. Fine.

> Sorry, maybe i was a bit to abstract. With units i meant the smallest element 
> in the program. Methods like compare_integer_equal. e.g.
> Please find two examples in the test-directory i created. You can revert the 
> commit anytime if you like.

Looks really good.

> Of course i used the one’s which have been easiest to convert into the new 
> structure. Just to get an idea.
> You just “complained" in a former email that the unit tests became obsolete 
> because the structure changed a lot. I just wanted to state that it is also 
> due to the reason that most of the tests are integration tests and use a lot 
> of functions from all over.
> Which of course needs a lot of time to maintain, e.g. modifier_test.

I still don't get it completely (difference between "integration-"
and some other kind of test), may be have a knot in my mind.
But all is fine, you don't have to explain it again, just go ahead!

> > I agree. Is it possible to call it in singular, i.e. "test/".
> > Please create this new directory in the CYBOP project's root,
> Done, please have a look!

Does not look too complicated and quite easy to handle.
Good improvement.

Magic, how CMake compiles and creates these executables
and knows about the dependencies on CYBOI source code.

Most files in "src/tester/" currently might not work.
So don't worry! They can be updated over time, step-by-step.

> > My suggestion for you:
> > 1 Focus on CMake first, until it works.
> > 2 Afterwards, try to implement (only) one or two unit tests.
> I did it already :)

Well, all-right.
If you like, then move all content from "src/tester/" to "test/".
Once ready, please inform me, so that I can remove the directory
"src/tester/" from SVN and also "src/controller/tester.c"
and moreover the test-related command-line arguments of cyboi.

Cleaning up is always good to keep overview and everything slim.

> What do you think? :)

Great idea and stuff.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]