0

I want to run some cleanup code like stopping database service. I am currently using std::sync::Once::call_once:

fn init() {
    INIT.call_once(|| {
        //start database
    });
}

I put this function in each test. Now I want to run another function which will be executed when all tests are finished. How can I do that?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
너를 속였다
  • 899
  • 11
  • 26

0 Answers0