Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #8949

Closed (moved)
Open
Opened May 23, 2013 by Nick Mathewson@nickm🥄

Add a way to do mocking for Tor unit tests

Right now, one of our biggest obstacles to improved test coverage is the fact that we don't have a good way to mock functions during C testing.

There are a big pile of mocking tools for C, but they mostly suck and either want you to split your code up weirdly, litter it with macro salad, or such.

There's another class of solution based on preprocessing C or postprocessing assembly, but both approaches are fragile, and we'd probably need to polish or maintain whatever tool we wound up using. Not a great situation to be in. I've maintained compiler wrappers. (It was a bad scene, man.)[http://www.pmg.csail.mit.edu/polyj/]

Still, our current low test coverage is worse still; worse even than macro salad; worse even than magic compiler wrappers. So we ought to bite the bullet and figure out the least difficult and least awful option and do it.

(Please don't just post the results of a search on "c mocking tools" or "c unit testing" here: I can do that search too.)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.2.5.x-final
Milestone
Tor: 0.2.5.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#8949