1use serde::{Deserialize, Serialize};
8use std::env;
9use std::path::PathBuf;
10
11#[derive(Clone, Debug, Deserialize, Serialize)]
13#[serde(deny_unknown_fields)]
14pub struct SolanaTestConfig {
15 pub init: InitSection,
16}
17
18impl Default for SolanaTestConfig {
19 fn default() -> Self {
20 Self {
21 init: InitSection::default(),
22 }
23 }
24}
25
26#[derive(Clone, Debug, Deserialize, Serialize)]
27#[serde(deny_unknown_fields)]
28pub struct InitSection {
29 pub path: PathBuf,
31 pub framework_repo_url: String,
33 pub test_file_path: PathBuf,
35 pub framework_name: String,
37 pub framework_branch: String,
39 pub is_anchor: Option<bool>,
41}
42
43impl Default for InitSection {
44 fn default() -> Self {
45 let current_dir = env::current_dir().expect("Cannot determine current dir");
46 Self {
47 path: current_dir.clone(),
48 test_file_path: current_dir.clone().join("tests/genereted_test.rs"),
49 framework_repo_url: String::from(
50 "https://github.com/lowprivuser/solana-test-framework",
51 ),
52 framework_name: String::from("solana-test-framework"),
53 framework_branch: String::from("main"),
54 is_anchor: None,
55 }
56 }
57}