test/fpsensor: Run the fpsensor test on device

BRANCH=none
BUG=b:171370392
TEST=Using dragonclaw v0.2 and servo_micro:
     ./test/run_device_tests.py -t fpsensor

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Idc24d9bdd5574ca7099e97e86e3b49011844380c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2507951
Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
This commit is contained in:
Tom Hughes 2020-10-28 16:52:17 -07:00 committed by Commit Bot
parent 27797ea91d
commit a6ec60c2f3
7 changed files with 30 additions and 12 deletions

View File

@ -17,6 +17,7 @@ test-list-y=\
crc32 \
flash_physical \
flash_write_protect \
fpsensor \
mpu \
mutex \
pingpong \

View File

@ -18,6 +18,7 @@ test-list-y=\
crc32 \
flash_physical \
flash_write_protect \
fpsensor \
mpu \
mutex \
pingpong \

View File

@ -14,6 +14,7 @@ test-list-y=\
aes \
compile_time_macros \
crc32 \
fpsensor \
mutex \
pingpong \
rsa \

View File

@ -27,8 +27,15 @@ test_static int test_validate_fp_buffer_offset_failure_overflow(void)
void run_test(int argc, char **argv)
{
RUN_TEST(test_validate_fp_buffer_offset_success);
RUN_TEST(test_validate_fp_buffer_offset_failure_no_overflow);
RUN_TEST(test_validate_fp_buffer_offset_failure_overflow);
test_print_result();
if (IS_ENABLED(HAS_TASK_FPSENSOR)) {
/* TODO(b/171924356): The "emulator" build only builds RO and
* the functions used in the tests are only in RW, so these
* tests are not run on the emulator.
*/
RUN_TEST(test_validate_fp_buffer_offset_success);
RUN_TEST(test_validate_fp_buffer_offset_failure_no_overflow);
RUN_TEST(test_validate_fp_buffer_offset_failure_overflow);
test_print_result();
return;
}
}

View File

@ -3,10 +3,12 @@
* found in the LICENSE file.
*/
#define CONFIG_TEST_MOCK_LIST \
MOCK(FP_SENSOR) \
MOCK(FPSENSOR_DETECT) \
MOCK(FPSENSOR_STATE) \
MOCK(MKBP_EVENTS) \
MOCK(ROLLBACK) \
#ifdef BOARD_HOST
#define CONFIG_TEST_MOCK_LIST \
MOCK(FP_SENSOR) \
MOCK(FPSENSOR_DETECT) \
MOCK(FPSENSOR_STATE) \
MOCK(MKBP_EVENTS) \
MOCK(ROLLBACK) \
MOCK(TIMER)
#endif /* BOARD_HOST */

View File

@ -6,6 +6,10 @@
/**
* See CONFIG_TASK_LIST in config.h for details.
*/
#define CONFIG_TEST_TASK_LIST \
TASK_TEST(FPSENSOR, fp_task_simulate, NULL, TASK_STACK_SIZE)
#define CONFIG_TEST_TASK_LIST
#ifdef BOARD_HOST
#undef CONFIG_TEST_TASK_LIST
#define CONFIG_TEST_TASK_LIST \
TASK_TEST(FPSENSOR, fp_task_simulate, NULL, TASK_STACK_SIZE)
#endif

View File

@ -114,6 +114,8 @@ class AllTests:
TestConfig(name='flash_write_protect',
image_to_use=ImageType.RO,
toggle_power=True, enable_hw_write_protect=True),
'fpsensor':
TestConfig(name='fpsensor'),
'mpu_ro':
TestConfig(name='mpu',
image_to_use=ImageType.RO,