diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-09-21 14:23:13 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-09-23 00:24:43 -0400 |
commit | d4b54549b83bbbfeb9c1d7d843ea244eed389c61 (patch) | |
tree | 07456ee45551880371239a77621bd7e35ed2ab0a /src/or/Makefile.am | |
parent | 1c2d7732f0a2d74e61bc4276421bec78b2256f64 (diff) | |
download | tor-d4b54549b83bbbfeb9c1d7d843ea244eed389c61.tar.gz tor-d4b54549b83bbbfeb9c1d7d843ea244eed389c61.zip |
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.
Diffstat (limited to 'src/or/Makefile.am')
-rw-r--r-- | src/or/Makefile.am | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/Makefile.am b/src/or/Makefile.am index e9916d5188..04a66d061c 100644 --- a/src/or/Makefile.am +++ b/src/or/Makefile.am @@ -42,7 +42,7 @@ tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@ tor_LDADD = ../common/libor.a ../common/libor-crypto.a \ ../common/libor-event.a \ -lz -lm -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@ -test_SOURCES = $(COMMON_SRC) test_data.c test.c +test_SOURCES = $(COMMON_SRC) test_data.c test.c tinytest.c test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ @TOR_LDFLAGS_libevent@ @@ -50,7 +50,10 @@ test_LDADD = ../common/libor.a ../common/libor-crypto.a \ ../common/libor-event.a \ -lz -lm -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@ -noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i +noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i tinytest.h \ + tinytest_macros.h + +EXTRA_DIST = tinytest_demo.c config_codedigest.o: or_sha1.i |