mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-21 21:44:58 +02:00
b6e8c74667
This is not the most beautiful possible implementation (it requires decorating mockable functions with ugly macros), but it actually works, and is portable across multiple compilers and architectures.
29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
o Build features:
|
|
|
|
- Tor now builds each source file in two modes: a mode that avoids
|
|
exposing identifiers needlessly, and another mode that exposes
|
|
more identifiers for testing. This lets the compiler do better at
|
|
optimizing the production code, while enabling us to take more
|
|
radical measures to let the unit tests test things.
|
|
|
|
- The production builds no longer include functions used only
|
|
in the unit tests; all functions exposed from a module for
|
|
unit-testing only are now static in production builds.
|
|
|
|
- Add an --enable-coverage configuration option to make the unit
|
|
tests (and a new src/or/tor-cov target) to build with gcov test
|
|
coverage support.
|
|
|
|
o Testing:
|
|
|
|
- We now have rudimentary function mocking support that our unit
|
|
tests can use to test functions in isolation. Function mocking
|
|
lets the tests temporarily replace a function's dependencies with
|
|
stub functions, so that the tests can check the function without
|
|
invoking the other functions it calls.
|
|
|
|
|
|
|
|
|
|
|