1pub use bench_runner::{
7 BenchError as RunnerError, BenchReport as RunnerReport, BenchSample, BenchSpec,
8};
9
10use std::path::PathBuf;
11
12#[derive(Debug, thiserror::Error)]
14pub enum BenchError {
15 #[error("runner error: {0}")]
17 Runner(#[from] bench_runner::BenchError),
18
19 #[error("unknown benchmark function: {0}")]
21 UnknownFunction(String),
22
23 #[error("execution error: {0}")]
25 Execution(String),
26
27 #[error("I/O error: {0}")]
29 Io(#[from] std::io::Error),
30
31 #[error("serialization error: {0}")]
33 Serialization(#[from] serde_json::Error),
34
35 #[error("configuration error: {0}")]
37 Config(String),
38
39 #[error("build error: {0}")]
41 Build(String),
42}
43
44#[derive(Debug, Clone, Copy, PartialEq, Eq)]
46pub enum Target {
47 Android,
49 Ios,
51 Both,
53}
54
55impl Target {
56 pub fn as_str(&self) -> &'static str {
57 match self {
58 Target::Android => "android",
59 Target::Ios => "ios",
60 Target::Both => "both",
61 }
62 }
63}
64
65#[derive(Debug, Clone)]
67pub struct InitConfig {
68 pub target: Target,
70 pub project_name: String,
72 pub output_dir: PathBuf,
74 pub generate_examples: bool,
76}
77
78#[derive(Debug, Clone)]
80pub struct BuildConfig {
81 pub target: Target,
83 pub profile: BuildProfile,
85 pub incremental: bool,
87}
88
89#[derive(Debug, Clone, Copy, PartialEq, Eq)]
91pub enum BuildProfile {
92 Debug,
94 Release,
96}
97
98impl BuildProfile {
99 pub fn as_str(&self) -> &'static str {
100 match self {
101 BuildProfile::Debug => "debug",
102 BuildProfile::Release => "release",
103 }
104 }
105}
106
107#[derive(Debug, Clone)]
109pub struct BuildResult {
110 pub platform: Target,
112 pub app_path: PathBuf,
114 pub test_suite_path: Option<PathBuf>,
116}