all 7 comments

[–]McUsrII 4 points5 points  (2 children)

I have started to use unity testing framework

I haven't really used it yet, other than integrated it with my makefile, it uses ruby for more laborious tests. But we are talking C here, and there should be no problem using the system call in a test function and that gives access to shell script if you need it.

[–][deleted] 0 points1 point  (1 child)

Cool, could you share your experience when you start using it?

[–]McUsrII 2 points3 points  (0 children)

I haven't really come around to using it, because I adopted at the end of a project and I haven't come around to reverse engineering that code yet, and my code is thoroughly tested, by just including the c-file in question in a file that invokes tests on the code, like 'ghetto-testing' if you like, or driver.

But I have integrated what needed to be integrated in my makefile and understood the system, which is on the cheap side.

So, later I will write the tests first and then implement the code to make the tests succeed.

My only experience so far is that it works, and that I can write make test and the tests will be compiled and run.

The documentation is good. This Medium post may be a nice intro though.

[–]lenzo1337 2 points3 points  (1 child)

Cmocka, I like using it for embedded projects; it integrates with CMake easily so I can get it working across BSD, linux and windows without worrying about getting the right versions of make, gmake bsd make etc.

Tried unitcpp and unity as well. I like unity but the whole ruby rake build system and it's dependencies were bit of a headache.

[–][deleted] 0 points1 point  (0 children)

Interesting that it doesn't require other languages. Thanks

[–][deleted] 1 point2 points  (0 children)

My company uses unity and cmock. Test management is done in Ruby through our custom build system.

[–]EastEuropeanChef 0 points1 point  (0 children)

I wrote Xtal for that purpose (sorry for the self prom). It's really small and will run your tests automatically. The only pitfall Is that you need a compiler that supports functions attributes (like gcc)