Question

On Windows XP, using TDM's GCC/MinGW32 for basic development i.e. gcc 4.4.x with gdb. Which unit testing framework to use for test driven development?

Apparently Check's unit tests don't yet work on Windows.

The questions at Unit Testing Frameworks for C and Unit Testing C Code are similar but not specifically about using gcc 4.4.x on Windows.

Was it helpful?

Solution

Awesome slides from a talk on TDD with C, using nothing but C99 standard stuff.

Personally I like the stuff in glib, which you may be able to use in MinGW.

OTHER TIPS

minunit only is four macros long, so it'll compile on any platform. It's not fully-featured, but does the job, and can be easily extended to fit your needs.

Cut is the only C unit testing framework I know that can run on Windows. Check does work on Windows via Cygwin (that's what I am currently using).

As of version 0.9.11, check does support Windows on the MinGW and Cygwin platforms.

As the MinGW platform does not have a fork() equivalent, using the fork() mode in check is unavailable. However, Cygwin does provide a fork() implementation for check to use.

Take a look at cmocka, a unit testing framework for C with support for mock objects. It is tested and supported on Windows.

https://cmocka.org

Personally I like cfix, which is not only aimed at Windows C developers, but also supports both user and kernel mode code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top