unit testing with autotools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'd like to do unit testing for test-driven development of C programs. I'd also like to use up-to-date autotools. I was wondering if anyone had any experience with unit testing in their projects and had recommendations, or even if autoconf was considering it for the future.

By unit testing I mean writing multiple small tests for each function in an interface. The prescribed development methodology is to write failing tests before you write code that will make them pass.

Autotest would be good as a wrapper around a unit-testing framework, but not good for driving the actual low-level tests. The same goes for DejaGNU. So far I have looked at the following projects:

check
http://check.sourceforge.net/
  -- runs tests in their own address space
  -- built for 2.13 series, needs updating a bit

CppUnit
http://cppunit.sourceforge.net/cppunit-wiki
  -- C++ but you can use it for C
  -- GUI-fied
  -- active development, stable

MinUnit (if that's even a project)
http://www.jera.com/techinfo/jtns/jtn002.html
  -- just some simple simple macros

autounit (heh)
http://freshmeat.net/projects/autounit/
  -- runs tests in their own address space
  -- depends on GLib

CUnit for Mr. Ando
http://park.ruru.ne.jp/ando/work/CUnitForAndo/html/
  -- quite minimal

cUnit
http://web.archive.org/web/20031009180557/http://people.codefactory.se/~spotty/cunit/
  -- apparently a dead project
  -- uses GLib

From this list, I exclude autounit and cUnit for GLib dependency. CUnit for Mr. Ando and MinUnit are too minimal (I'd like something a bit more developed --- I think). So it comes down to either:

  1) fix check for current autotools (effort) and use it
  2) use CppUnit for stability and just deal with C++

and then wrapping Autotest around the testing framework. But if this list had any comments on what to do about unit testing with autotools in general I'd be interested.

Since I'm at the unique point in my life where I'm pushing code out of one project into a library, I have a chance to do this unit-testing thing right from the beginning. But getting started is proving harder than I expected. My goal is actually to make a hello world example available for it if I can, starting from Alexandre's amhello without the gettext stuff.

I'm also interested in more detailed or "best practice" autotest tutorials but the advice in the archives seems to be, "look at other projects and existing tutorials and cobble something together."

Cheers,
Chris
--
Chris Pickett, Ph.D. student
Sable Research Group                     Center for Advanced Studies
McGill University, Montreal              IBM Toronto Lab, Markham
http://www.sable.mcgill.ca/~cpicke/


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux