blob: 1c9f8027760fdbc4891ad0e9cec284d92bead325 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 | use crate::common::types::ProcessedCli;
use std::fs::File;
use std::io::Write;
pub mod compare;
pub mod gen_c;
pub mod gen_rust;
pub mod types;
pub mod values;
/// Architectures must support this trait
/// to be successfully tested.
pub trait SupportedArchitectureTest {
    fn create(cli_options: ProcessedCli) -> Self;
    fn build_c_file(&self) -> bool;
    fn build_rust_file(&self) -> bool;
    fn compare_outputs(&self) -> bool;
}
pub fn write_file(filename: &String, code: String) {
    let mut file = File::create(&filename).unwrap();
    file.write_all(code.into_bytes().as_slice()).unwrap();
}
 |