defined runTests
This commit is contained in:
19
9unit.h
19
9unit.h
@@ -22,11 +22,12 @@
|
||||
typedef struct TestState
|
||||
{
|
||||
int run; // number of tests run
|
||||
int success; // number of successful tests
|
||||
int failure; // number of failed tests
|
||||
int passed; // number of successful tests
|
||||
int failed; // number of failed tests
|
||||
int postponed; // number of postponed tests
|
||||
} TestState;
|
||||
|
||||
// Possible results of running a single test
|
||||
typedef enum TestResult
|
||||
{
|
||||
test_success,
|
||||
@@ -34,8 +35,20 @@ typedef enum TestResult
|
||||
test_postponed
|
||||
} TestResult;
|
||||
|
||||
// Initializes a TestState value
|
||||
extern void initTestState(TestState *);
|
||||
|
||||
extern void runTest(TestState *, TestResult (*)(void));
|
||||
// Runs a single test
|
||||
extern void runTest(
|
||||
TestState *, // the TestState data
|
||||
TestResult (*)(void) // the test to run
|
||||
);
|
||||
|
||||
// Runs multiple tests
|
||||
extern void runTests(
|
||||
// function that runs the tests and updates the provided TestState
|
||||
void (*)(TestState *)
|
||||
);
|
||||
|
||||
|
||||
//jl
|
||||
|
||||
Reference in New Issue
Block a user