1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

tests: Add selfcheck to unit tests

Add unit tests for programmer_table, flashchips, and board_matches
structs. The tests are derived from the selfcheck function, checking
that the required fields have been filled in.

BUG=b:140595239
BRANCH=None
TEST=meson test

Change-Id: I41cd014d9bf909296b6c28e3e00548e6883ff41a
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69620
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Evan Benn
2022-11-14 16:02:47 +11:00
committed by Anastasia Klimchuk
parent 8274c6321a
commit 62ec7b7156
6 changed files with 174 additions and 0 deletions

View File

@ -381,6 +381,15 @@ int main(int argc, char *argv[])
};
ret |= cmocka_run_group_tests_name("helpers.c tests", helpers_tests, NULL, NULL);
const struct CMUnitTest selfcheck[] = {
cmocka_unit_test(selfcheck_programmer_table),
cmocka_unit_test(selfcheck_flashchips_table),
cmocka_unit_test(selfcheck_eraseblocks),
cmocka_unit_test(selfcheck_board_matches_table),
};
ret |= cmocka_run_group_tests_name("selfcheck.c tests", selfcheck,
NULL, NULL);
const struct CMUnitTest flashrom_tests[] = {
cmocka_unit_test(flashbuses_to_text_test_success),
};