| 1 |
/* |
| 2 |
* This file is part of the flashrom project. |
| 3 |
* |
| 4 |
* Copyright 2021 Google LLC |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; version 2 of the License. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef __LIFECYCLE_H__ |
| 17 |
#define __LIFECYCLE_H__ |
| 18 |
|
| 19 |
#include <include/test.h> |
| 20 |
#include <string.h> |
| 21 |
#if defined(__linux__) && !defined(__ANDROID__) |
| 22 |
#include <linux/spi/spidev.h> |
| 23 |
#endif |
| 24 |
|
| 25 |
#include "tests.h" |
| 26 |
#include "libflashrom.h" |
| 27 |
#include "io_mock.h" |
| 28 |
#include "programmer.h" |
| 29 |
#include "spi.h" |
| 30 |
|
| 31 |
void run_basic_lifecycle(void **state, const struct io_mock *io, |
| 32 |
const struct programmer_entry *prog, const char *param); |
| 33 |
|
| 34 |
void run_probe_v2_lifecycle(void **state, const struct io_mock *io, |
| 35 |
const struct programmer_entry *prog, const char *param, |
| 36 |
const char *const chip_name, |
| 37 |
const char **expected_matched_names, unsigned int expected_matched_count); |
| 38 |
|
| 39 |
void run_init_error_path(void **state, const struct io_mock *io, |
| 40 |
const struct programmer_entry *prog, const char *param, const int error_code); |
| 41 |
#endif /* __LIFECYCLE_H__ */ |