Hello Martin, * Martin Kalbfuß wrote on Thu, Sep 17, 2009 at 01:12:44AM CEST: > I try to build up a test suit for my library. I have a description for > using autotest for a program. But haven't found anything about testing > libraries. Are there any good descriptions or examples?
Examples for tests? No idea. The gnulib repository contains oodles of tests. Maybe looking at them helps you write them? > Currently I only have > > TESTS = slltest > check_PROGRAMS = $(TESTS) > slltest_SOURCES = slltest.c > slltest_INCLUDES = sll.h > slltest_LDADD = libsk.a > > in my Makefile.am. A minor lingo nit, "Autotest" is a different test suite driver, it comes with Autoconf and is purely m4 and shell based: <http://www.gnu.org/software/autoconf/manual/html_node/Using-Autotest.html> What you're looking at is the simple test driver from Automake. Incidentally, the Libtool package tests a library (libltdl) among other things, and uses both Autotest and the simple driver from Automake. If I were writing tests for a library, I'd be writing a bunch of small programs as unit tests of library specifics, and maybe a larger one that tries out more complex operations, and some shell scripts calling that larger program with different options: unittests = unit1 unit2 ... scripttests = script1 script2 ... check_PROGRAMS = $(unittests) large-prog ... check_SCRIPTS = $(scripttests) helper-script ... TESTS = $(unittests) $(scripttests) LDADD = libsk.a You should check out parallel-tests from Automake 1.11: <http://www.gnu.org/software/automake/manual/html_node/Tests.html> Cheers, Ralf
