[Top][All Lists]

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

Re: [cybop-developers] UnitTests

From: Enrico Gallus
Subject: Re: [cybop-developers] UnitTests
Date: Wed, 8 Mar 2017 12:37:28 +0900


last thing for today. Sorry for spamming the mailing list like that.
I am relieved that you like it! Taking over the test will take some time, but it is not that urgent. I just wanted to show a way how it could be done.
Maybe there are better ways to use the CTest framework. I already have some improvements in mind and put some todo’s to the cmake files.

The tests i converted have been really simple, because they did not include any other c-files.
I tried a “complicate” example and converted the unit tests for the integer calculation.

It was like hell… Is it that terrible to work with c? I mean, i’m using Visual Studio Code with an C-Extension, you probably use eclipse with the CDT extension?
To gather all the includes in the test file, just because the method under test “calculate_integer_absolute” uses the logger which has some forward declarations was awful.
In the end the include lists contains now a lot of comparator/memoriser and modifier includes. I guess it can’t be helped.

I just started coding C, so maybe there is a better way to provide the includes in the INTEGER_CALCULATOR_TESTER_SOURCE 
I appreciate any ideas for improvement.
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.
I put this to my TODO-list and would like to fix the cmake first.

What do you think? :)

Great idea and stuff.



reply via email to

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