micah.cowan.name

Checkmk Project Page

What is Checkmk?

Checkmk is a tool that translates concise versions of test suites into C programs suitable suitable for use with the Check unit test framework. It is intended for use with Arien Malec's Check unit test framework, which is available at http://check.sourceforge.net/. It's unlikely to be of interest to anyone unfamiliar with the Check testing framework.

Checkmk is Free Software (non-copyleft); you can pretty much do whatever you like with it (for exact terms of use and distribution, please examine the contents of Checkmk; it's a variant on the typical BSD or X11 license).

What does Checkmk do?

In a nutshell, using the checkmk command lets you write unit test source files like:

#include <stdio.h>

#test the_test
    int nc;
    const char msg[] = "\n\n    Hello, world!\n";

    nc = printf("%s", msg);
    fail_unless(nc == (sizeof msg
                                  - 1) /* for terminating NUL. */
    );

instead of like:

#include <check.h>

#include <stdio.h>

START_TEST(the_test)
{
    int nc;
    const char msg[] = "\n\n    Hello, world!\n";

    nc = printf("%s", msg);
    fail_unless(nc == (sizeof msg
                                  - 1) /* for terminating NUL. */
    );
}
END_TEST

int main(void)
{
    Suite *s1 = suite_create("Core");
    TCase *tc1_1 = tcase_create("Core");
    SRunner *sr = srunner_create(s1);
    int nf;

    suite_add_tcase(s1, tc1_1);
    tcase_add_test(tc1_1, the_test);

    srunner_run_all(sr, CK_ENV);
    nf = srunner_ntests_failed(sr);
    srunner_free(sr);

    return nf == 0 ? 0 : 1;
}

For more information, read the checkmk manpage ( HTML | PDF | PS ).

How Do I Get Checkmk?

I'm preparing to release version 1.0 very soon. Meanwhile, here is the current prerelease version (thoroughly tested, and expected to be extremely similar to the final product).

You can also pull down the latest version from my SVN repository, with the command svn co svn://micah.cowan.name/checkmk/trunk. Or you can browse the SVN repository if you like.