Skip to content

Commit

Permalink
test multiple init/shutdown cycles
Browse files Browse the repository at this point in the history
In `PolyscopeTest` fixture, initialise polyscope at the start of each test and shutdown at the end. This will test multiple shutdown cycles during the lifetime of the fixture.
  • Loading branch information
gkoulin committed Oct 2, 2024
1 parent 92cc9ee commit fc74f12
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/include/polyscope_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class PolyscopeTest : public ::testing::Test {
polyscope::options::enableRenderErrorChecks = true;
polyscope::options::errorsThrowExceptions = true;
polyscope::options::hideWindowAfterShow = false;
polyscope::init(testBackend);
}

// Per-test-suite tear-down.
Expand All @@ -46,10 +45,14 @@ class PolyscopeTest : public ::testing::Test {
*/

// You can define per-test set-up logic as usual.
// virtual void SetUp() { ... }
void SetUp() override {
polyscope::init(testBackend);
}

// You can define per-test tear-down logic as usual.
// virtual void TearDown() { ... }
void TearDown() override {
polyscope::shutdown();
}

// Some expensive resource shared by all tests.
// static T* shared_resource_;
Expand Down

0 comments on commit fc74f12

Please sign in to comment.