[tor-bugs] #25386 [- Select a component]: fix rust tests

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Feb 28 15:57:45 UTC 2018


#25386: fix rust tests
--------------------------------------+--------------------
     Reporter:  Hello71               |      Owner:  (none)
         Type:  enhancement           |     Status:  new
     Priority:  High                  |  Milestone:
    Component:  - Select a component  |    Version:
     Severity:  Normal                |   Keywords:
Actual Points:                        |  Parent ID:
       Points:                        |   Reviewer:
      Sponsor:                        |
--------------------------------------+--------------------
 currently, it is not possible to call C Tor, directly or indirectly, from
 rust tests. one of the following must be done:

 1. provide rust stubs for all C functions that may be needed for tests
 (impractical)

 2. test rust functions from C (so we will have C tests calling Rust
 functions calling C functions)

 3. link C functions into rust doctests (preferred)

 4. never call C-using rust functions in tests (leads to poor test
 coverage, very bad)

 my branch https://cgit.alxu.ca/tor.git/commit/?h=fix-rust-tests implements
 option 3 poorly. this is a bad solution firstly because it is very ugly,
 and secondly because it does not properly pass the system linking
 arguments, e.g. -L/opt/ssl. thirdly, it may hide problems in or cause to
 be compiled incorrectly dependency crates.

 this ticket blocks a number of rust improvements, since of course we would
 like to actually test the improvements, and doctests are the best way to
 do it in rust.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25386>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list