mardi 26 juillet 2016

How to print to stdout during unit test for c language

I'm writing C unit test with this unit testing framework: check

It feels good, but now I would want to insert some test prints to stdout which would show in the results when I run the tests in netbeans.

Currently I only see messages that are inserted with the convenience test functions: convenience test functions.

How could I see in the outputs the printfs or some myself generated prints?

Example test code:

START_TEST(test_something)
{
    printf("a printf I would like to see in the output");
    fail("some fail message");
}
END_TEST

Now how could I see the printf in the code in the test output (or at least somewhere).

Aucun commentaire:

Enregistrer un commentaire