Yeah, but it is also quite easy to implement a Test::More
like testsuite in C with libtab (http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap
). This library is pretty small, so you can ship it with your program. I just added a 't' directory in my autoconf based project and put the libtab header and sources there. Tests look pretty much the same as in Perl:
* A simple example of a test.
ok(1 + 1 == 2, "Basic arithmetic works");
return exit_status(); /* Return the correct exit code */
A simple t/Makefile.am could look like this:
check_PROGRAMS = simple_tests
simple_tests_SOURCES = simple_tests.c tap.c ../src/something.c\
simple_tests_CFLAGS = -Wall --pedantic -std=c99 -I ../src
TESTS = simple_tests
Then add 't' in your main Makefile.am:
SUBDIRS = src t
Then you can run the tests with 'make check'.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||