1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 16:47:34 +00:00

LibTest: Add TEST_SETUP macro that runs before all test cases

This commit is contained in:
Peter Elliott 2021-08-29 11:55:05 -07:00 committed by Andreas Kling
parent b0bd4be59a
commit 83680934e5
3 changed files with 22 additions and 1 deletions

View file

@ -43,6 +43,8 @@ public:
void current_test_case_did_fail() { m_current_test_case_passed = false; }
void set_suite_setup(Function<void()> setup) { m_setup = move(setup); }
private:
static TestSuite* s_global;
NonnullRefPtrVector<TestCase> m_cases;
@ -50,6 +52,7 @@ private:
u64 m_benchtime = 0;
String m_suite_name;
bool m_current_test_case_passed = true;
Function<void()> m_setup;
};
}