Commit Graph

15 Commits

Author SHA1 Message Date
Vic Yang
4de56d4a7f Test interface for detaching fake I2C devices
This provides an interface to detach and re-attach fake I2C devices,
which can be used to test I2C connection failure.

BUG=chrome-os-partner:19235
TEST=Pass sbs_charging test along with the next CL
BRANCH=None

Change-Id: Ibfee79b13d45e62377d894aa28547e77bef2189e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170752
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-27 04:33:33 +00:00
Vic Yang
d5e183f9e5 Fake I2C device support for emulator
To test drivers, we need a way to fake I2C periphrals. With this CL, a
fake peripheral can be done by declaring its own I2C read/write
functions. The fake I2C peripherals may return EC_ERROR_INVAL to
indicate it's not responding. The emulator I2C read/write call scans
through all registered I2C peripherals and uses the first response.

BUG=chrome-os-partner:19235
TEST=Pass sbs_charging test with the next CL.
BRANCH=None

Change-Id: I9380dc40e147781b42e09eb6979c864bbd9f2ac4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169511
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-17 03:22:12 +00:00
Vic Yang
b448746bac Add boot key test
This checks boot key combination like Power-F3-ESC and Power-F3-Down can
be properly detected.

BUG=chrome-os-partner:19236
TEST=Pass kb_scan test
BRANCH=None

Change-Id: I180918977299219a8421798dac2ab9fed84ef9a2
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167802
2013-09-05 07:20:56 +00:00
Vic Yang
6c3be20539 Add multi-step test support
We already have a multi-step test. Let's move it to test_util.c so that
upcoming tests can also use it.

BUG=chrome-os-partner:19235
TEST=Pass all tests
BRANCH=None

Change-Id: I6b7a036297f3b4b2778687488d1dc5b5bb4fe255
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167950
2013-09-05 07:20:46 +00:00
Vic Yang
f2046ce3dc Flush test coverage information before rebooting emulator
If we reboots the emulator without flushing test coverage information,
the test coverage report will be incorrect. Let's fix this by flushing
it before every reboot.

BUG=chrome-os-partner:19235
TEST=Generate test coverage report and check correctness.
BRANCH=None

Change-Id: I1eb060e419b767f382325bed841366c491ba56b7
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167770
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-09-04 20:32:45 +00:00
Vic Yang
0e9d829e91 Add test for console command history
This tests that command history is as expected. Also fix a bug that some
checks in console_edit test are skipped.

BUG=chrome-os-partner:19236
TEST=Pass console_edit test.
BRANCH=None

Change-Id: Ifbd3d1690f25b35bf5efe523e656b013aa534d26
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64837
2013-08-18 04:27:27 -07:00
Vic Yang
8218aa1346 Add system_common unit test
This tests reboot-on-ap-shutdown.

BUG=chrome-os-partner:19236
TEST=Pass the test
BRANCH=None

Change-Id: Ic1a07670f82646e85d014d52a2aba0835319c212
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62855
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-07-22 16:09:47 -07:00
Vic Yang
4d270c1507 Add thermal host and console command test
This checks the functionality of thermal engine related host and
console commands.

BUG=chrome-os-partner:19236
TEST=Pass all tests.
BRANCH=None

Change-Id: I604ed3bfed3549b2573fac65da83450acd3f2797
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60964
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-07-11 04:26:14 -07:00
Vic Yang
b3f1d0d059 Add function to inject console input from test
This can be used to test console command.

BUG=chrome-os-partner:19236
TEST=Build success
BRANCH=None

Change-Id: I7ce002f9e66fd7786492bacb453f126b9766d741
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60978
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-07-11 04:26:09 -07:00
Vic Yang
7de03b0f0e A method to mock host command
This will be used often, so let's move it to test_util.c.

BUG=chrome-os-partner:19235
TEST=Pass flash test.
BRANCH=None

Change-Id: I2f685f657f8742c2b29e3b9c88ba01daacf982f8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58793
2013-06-17 20:27:27 -07:00
Vic Yang
aaac3935d2 Make target for test coverage report generation
By 'make coverage', lcov is used to generate test coverage report in
HTML format stored in coverage_rpt folder.

BUG=chrome-os-partner:19235
TEST=Generate a report.
BRANCH=None

Change-Id: I44142eaaeb897cf09179764781120370920144cd
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58203
2013-06-16 20:14:01 -07:00
Vic Yang
cbee574e64 Unit test for queue implementation
BUG=chrome-os-partner:19236
TEST=Pass the test.
BRANCH=None

Change-Id: I575e4a9abfd9431e3b74c36da8c3d69285e5c0fb
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58032
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
2013-06-10 01:48:46 -07:00
Vic Yang
80105a9556 Enable flash unit test on emulator
BUG=chrome-os-partner:19236
TEST=Pass all tests
BRANCH=None

Change-Id: I09276292499b94b2d4810830de51e4c63a9b7342
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56704
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-06-03 14:34:10 -07:00
Vic Yang
fa9c222a79 Add hook test
Test of hook functionality.

BUG=chrome-os-partner:19236
TEST=Pass the test
BRANCH=None

Change-Id: I4700f3061edd0707932e935a719fc73c3976892e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50957
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-14 09:25:03 -07:00
Vic Yang
e71f008388 Put test utility macros in header
Several test utility macros have been duplicated across tests. Let's put
them in a single place.

BUG=chrome-os-partner:19236
TEST='make runtests', 'BOARD=spring make tests'
BRANCH=None

Change-Id: Ib0c9f829715425cc23e33b8ef456b17dfadab13c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50513
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-08 18:11:01 -07:00