Edward O'Callaghan | 6a2abda | 2020-05-20 20:10:20 +1000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
| 3 | |
| 4 | #include <include/test.h> |
| 5 | #include "tests.h" |
| 6 | |
| 7 | #include <stdio.h> |
| 8 | |
| 9 | /* redefinitions/wrapping */ |
| 10 | void __wrap_physunmap(void *virt_addr, size_t len) |
| 11 | { |
| 12 | fprintf(stderr, "%s\n", __func__); |
| 13 | } |
| 14 | void *__wrap_physmap(const char *descr, uintptr_t phys_addr, size_t len) |
| 15 | { |
| 16 | fprintf(stderr, "%s\n", __func__); |
| 17 | return NULL; |
| 18 | } |
| 19 | |
| 20 | int main(void) |
| 21 | { |
| 22 | int ret = 0; |
| 23 | |
Edward O'Callaghan | e8fc879 | 2020-05-22 18:42:11 +1000 | [diff] [blame] | 24 | const struct CMUnitTest helpers_tests[] = { |
| 25 | cmocka_unit_test(address_to_bits_test_success), |
| 26 | cmocka_unit_test(bitcount_test_success), |
| 27 | cmocka_unit_test(minmax_test_success), |
| 28 | cmocka_unit_test(strcat_realloc_test_success), |
| 29 | cmocka_unit_test(tolower_string_test_success), |
| 30 | cmocka_unit_test(reverse_byte_test_success), |
| 31 | cmocka_unit_test(reverse_bytes_test_success), |
| 32 | }; |
| 33 | ret |= cmocka_run_group_tests_name("helpers.c tests", helpers_tests, NULL, NULL); |
| 34 | |
Edward O'Callaghan | df3fb57 | 2020-05-22 16:46:52 +1000 | [diff] [blame] | 35 | const struct CMUnitTest flashrom_tests[] = { |
| 36 | cmocka_unit_test(flashbuses_to_text_test_success), |
| 37 | }; |
| 38 | ret |= cmocka_run_group_tests_name("flashrom.c tests", flashrom_tests, NULL, NULL); |
| 39 | |
Edward O'Callaghan | 2125edb | 2020-05-22 16:46:26 +1000 | [diff] [blame] | 40 | const struct CMUnitTest spi25_tests[] = { |
| 41 | cmocka_unit_test(spi_write_enable_test_success), |
| 42 | cmocka_unit_test(spi_write_disable_test_success), |
| 43 | cmocka_unit_test(probe_spi_rdid_test_success), |
| 44 | cmocka_unit_test(probe_spi_rdid4_test_success), |
| 45 | cmocka_unit_test(probe_spi_rems_test_success), |
| 46 | cmocka_unit_test(probe_spi_res1_test_success), |
| 47 | cmocka_unit_test(probe_spi_res2_test_success), |
| 48 | cmocka_unit_test(probe_spi_res3_test_success), |
| 49 | cmocka_unit_test(probe_spi_at25f_test_success), |
Edward O'Callaghan | af4fed9 | 2020-05-22 19:09:49 +1000 | [diff] [blame^] | 50 | cmocka_unit_test(probe_spi_st95_test_success), /* spi95.c */ |
Edward O'Callaghan | 2125edb | 2020-05-22 16:46:26 +1000 | [diff] [blame] | 51 | }; |
| 52 | ret |= cmocka_run_group_tests_name("spi25.c tests", spi25_tests, NULL, NULL); |
| 53 | |
Edward O'Callaghan | 6a2abda | 2020-05-20 20:10:20 +1000 | [diff] [blame] | 54 | return ret; |
| 55 | } |