A Simple Unit Test Framework

Over the past few years, I created Basic Unit Test (BUT), the simplest possible unit-test framework for C code that I could think of. I had one important criterion for it, and that was the code for the test driver had to be separate from the code for the test suites. I didn’t want to tie each test suite to a specific driver. I wanted the flexibility to write different drivers, possibly with different features, to be able to load and run the test suites.

Writing a Unit Test Framework in C

The C programming language was one of the first programming languages I ever learned (after learning Basic, APL, and Fortran). I haven’t written much in C lately and I miss it, so I decided I needed a project to write C on a regular basis.

One of the problems with writing C code is making sure it does what you intend it to do. I’ve made lots of mistakes in the past, and I’d like to reduce their likelihood a little. One way to do that is to test code thoroughly, so a unit-test framework would be useful.