I have a package that wraps a vendor library. There is one main object that is exposed (a simulator) and the changeable parts are all available by performing functions on the main object, made to look C++ ish with
I’d like to have some testing workflow like this:
m = MainApp() m.Init("simulator_setup.ini") v = m.GetViewer() # ... test the viewer m = nothing # set the main thing up for garbage collection # now start on next thing m = MainApp() m.Init("different_setup.ini") b = m.SomeOtherSubsystem() # ... test the subsystem # ... etc., etc
I have seen a suggestion here that recommends using do blocks. I can see how that would get me test setup, but I can’t see how that would get me test teardown. What I was hoping for was something like dynamic-wind in Racket … i.e., setup runs, my test runs, then teardown runs.
Perhaps this is already possible and easy in Julia, but I just haven’t figured it out yet?