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.
Showing
- Makefile.am 1 addition, 1 deletionMakefile.am
- src/common/Makefile.am 1 addition, 1 deletionsrc/common/Makefile.am
- src/common/test.h 0 additions, 184 deletionssrc/common/test.h
- src/or/Makefile.am 5 additions, 2 deletionssrc/or/Makefile.am
- src/or/test.c 72 additions, 130 deletionssrc/or/test.c
- src/or/test.h 66 additions, 0 deletionssrc/or/test.h
- src/or/tinytest.c 369 additions, 0 deletionssrc/or/tinytest.c
- src/or/tinytest.h 87 additions, 0 deletionssrc/or/tinytest.h
- src/or/tinytest_demo.c 215 additions, 0 deletionssrc/or/tinytest_demo.c
- src/or/tinytest_macros.h 167 additions, 0 deletionssrc/or/tinytest_macros.h
Loading
Please register or sign in to comment