|
| 1 | +use indexmap::{IndexMap, IndexSet}; |
1 | 2 | use serde::{Deserialize, Serialize}; |
2 | 3 |
|
3 | 4 | /// A Rust funtion with its file source, attributes, and raw function content. |
@@ -83,3 +84,30 @@ pub fn kani_path() -> String { |
83 | 84 | assert!(std::fs::exists(&path).unwrap()); |
84 | 85 | path |
85 | 86 | } |
| 87 | + |
| 88 | +/// Output of `kani list` command. |
| 89 | +#[derive(Debug, Serialize, Deserialize, Clone)] |
| 90 | +#[serde(rename_all = "kebab-case")] |
| 91 | +pub struct KaniList { |
| 92 | + pub kani_version: String, |
| 93 | + pub file_version: String, |
| 94 | + pub standard_harnesses: IndexMap<String, IndexSet<String>>, |
| 95 | + pub contract_harnesses: IndexMap<String, IndexSet<String>>, |
| 96 | + pub contracts: IndexSet<ContractedFunction>, |
| 97 | + pub totals: Total, |
| 98 | +} |
| 99 | + |
| 100 | +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] |
| 101 | +pub struct ContractedFunction { |
| 102 | + pub function: String, |
| 103 | + pub file: String, |
| 104 | + pub harnesses: Vec<String>, |
| 105 | +} |
| 106 | + |
| 107 | +#[derive(Debug, Serialize, Deserialize, Clone)] |
| 108 | +#[serde(rename_all = "kebab-case")] |
| 109 | +pub struct Total { |
| 110 | + pub standard_harnesses: usize, |
| 111 | + pub contract_harnesses: usize, |
| 112 | + pub functions_under_contract: usize, |
| 113 | +} |
0 commit comments