Adds the concept of an argument capturer which, when used with a matcher
in an EXPECT_CALL(...), will capture the value of the matching argument.
Change-Id: I9cb7e16a29e02f02c2ba997a94fa98140519ca51
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Up to this point KUnit only supported method style function mocking
where there was some type of class or context object and the function
was only accessed via a pointer.
This adds support for mocking any function via the __mockable attribute.
Change-Id: I22f325a0fda3d16f5fb22f07332848feaa196b41
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Nice mocks only fail when there is an expectation on a method, but none
match a given call. Strict mocks only pass when there is a matching
expectation for every call. Naggy mocks have the same pass/fail behavior
as nice, but report a warning in any case a strict mock would fail.
Change-Id: I87017601291ba4346b6f16b77b208eeb97b7674f
Signed-off-by: Felix Guo <felixguoxiuping@gmail.com>
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Added parameter formatters which provide string formatting for
parameters that have no matchers to be matched against.
Change-Id: Iafe3c676bc7cff4ec8a9d063fd17bcc99b4ded86
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Introduces basic class mocking, the ability to automatically generate a
Linux C-style class implementation whose behavior is controlled by test
cases, which can also set expectations on when and how mocks are called.
Change-Id: Id9d535be1da95dd42844c43f6dfcca3a7441bd81
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Adds a way to specify that certain conditions must be met at the end of
a test case.
Change-Id: I4f90a68bbedcbb71e2fe7a0353d22885f430f54f
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Added a way to add plugins that require a test module to be loaded
during initialization.
Change-Id: I1d03f8249631a91b0334ccbe0b06889f3678caff
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Added support for assertions which are like expectations except the test
terminates if the assertion is not satisfied.
Change-Id: I7fdcf4d0b602f2a5642ff50d2637e8ddd293ce7c
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Adds the core of KUnit along with a minimal set of features. In
particular, this adds:
- the base reporting infrastructure for reporting test results.
- the concept of test modules and test cases, which is how tests are
specified and organized.
- infrastructure for running test modules and cases on UML.
- expectations, which is how properties to be verified by a test are
asserted.
Change-Id: I61ea0abe30fd0f1679e5cd16d0c101b956380d52
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>