diff options
author | Craig Hesling <hesling@chromium.org> | 2019-07-25 14:58:23 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-31 22:16:40 +0000 |
commit | 09d4632e694ab69c1785fdad910025990a37f15d (patch) | |
tree | b89d9b570ec83e08a3a2fc5eb5af86b4bcfdb3cb /common/mock/build.mk | |
parent | fec7f289d57a4382fa508a8f66615d7f9767e99b (diff) | |
download | chrome-ec-09d4632e694ab69c1785fdad910025990a37f15d.tar.gz |
mock: Add mock structure for fuzzers and tests
This introduces the common/mock and include/mock directories
which hold mock implementations of other common libraries.
The general idea it to create mocks which can be used in
simple scenarios, by providing meaningful default return
values and functionality, and more complicated scenarios
like fuzzers, where the return values need to continuously change.
The build system has been adapted to allow the inclusion of
a new .mocklist file for tests and fuzzers. This file specifies
exactly which mocks will be pulled into the build for a given
test/fuzz. In order to maintain cleanliness, this file is optional.
Examples:
* http://crrev.com/c/1682945/17 makes use of three different mocks,
one of which is the rollback mock.
* An upcoming rollback unit test ( http://crrev.com/c/1686460 ),
needs to pull in mocks that support the rollback interface, but
explicitly cannot pull in the rollback mock.
BRANCH=none
BUG=b:116065496
TEST=make buildall -j
Change-Id: Ib87b1a93b6d73309afaf7115276ead49218598ff
Signed-off-by: Craig Hesling <hesling@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719569
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common/mock/build.mk')
-rw-r--r-- | common/mock/build.mk | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/mock/build.mk b/common/mock/build.mk new file mode 100644 index 0000000000..190dde9be8 --- /dev/null +++ b/common/mock/build.mk @@ -0,0 +1,8 @@ +# Copyright 2019 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# See common/mock/README.md for more information. + +# Example: +# mock-$(HAS_MOCK_ROLLBACK) += rollback_mock.o
\ No newline at end of file |