]> git.ipfire.org Git - thirdparty/tor.git/commit
Refactor unit tests to use the tinytest framework.
authorNick Mathewson <nickm@torproject.org>
Mon, 21 Sep 2009 18:23:13 +0000 (14:23 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 23 Sep 2009 04:24:43 +0000 (00:24 -0400)
commitd4b54549b83bbbfeb9c1d7d843ea244eed389c61
tree07456ee45551880371239a77621bd7e35ed2ab0a
parent1c2d7732f0a2d74e61bc4276421bec78b2256f64
Refactor unit tests to use the tinytest framework.

"Tinytest" is a minimalist C unit testing framework I wrote for
Libevent.  It supports some generally useful features, like being able
to run separate unit tests in their own processes.

I tried to do the refactoring to change test.c as little as possible.
Thus, we mostly don't call the tinytest macros directly.  Instead, the
test.h header is now a wrapper on tinytest.h to make our existing
test_foo() macros work.

The next step(s) here will be:
  - To break test.c into separate files, each with its own test group.
  - To look into which things we can test
  - To refactor the more fiddly tests to use the tinytest macros
    directly and/or run forked.
  - To see about writing unit tests for things we couldn't previously
    test without forking.
Makefile.am
src/common/Makefile.am
src/common/test.h [deleted file]
src/or/Makefile.am
src/or/test.c
src/or/test.h [new file with mode: 0644]
src/or/tinytest.c [new file with mode: 0644]
src/or/tinytest.h [new file with mode: 0644]
src/or/tinytest_demo.c [new file with mode: 0644]
src/or/tinytest_macros.h [new file with mode: 0644]