Describe
Describe is to wrap a set of tests against one functionality; module, structure, set of functions, etc.
The describe construct initializes a test suite. All test suites must begin with a describe construct. Any other constructs outside describe is undefined behavior.
Describe constructs cannot be nested inside another describe. To wrap a set of tests against the functionality under a specific state, use context blocks.
describe(char* test_suite_description, void test_suite_function_handle(Awry*))
If your compiler supports the __attribute__((constructor))
definition, the describe macro accepts the test suite description and function handle.
describe(void test_suite_function_handle(Awry*))
If your compiler does not support the __attribute__((constructor))
definition, the describe macro accepts only the function handle. The test suite description can be passed when the suite is registered in Awry.
Awry.register_suite(&Awry, "test_suite_description", test_suite_function_handle);
Example
#include "awry/awry.h"
describe("describe construct", test_describe_construct)
it("creates a non-null function reference")
expect((void*)test_describe_construct) to not be_null
end
it("defines the function")
expect((void*)test_describe_construct) to equal((void*)test_describe_construct)
end
end
int main(void) {
Awry.run();
Awry.clear(&Awry);
return 0;
}
- Previous
- Next