-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
387 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
use anyhow::Error; | ||
use anyhow::{bail, Error}; | ||
use fehler::throws; | ||
use trdelnik_client::*; | ||
|
||
use crate::_discover; | ||
|
||
use super::init::CARGO_TOML; | ||
|
||
#[throws] | ||
pub async fn build(root: String) { | ||
let commander = Commander::with_root(root); | ||
commander.create_program_client_crate().await?; | ||
commander.build_programs().await?; | ||
commander.generate_program_client_deps().await?; | ||
commander.generate_program_client_lib_rs(None).await?; | ||
pub async fn build(root: Option<String>) { | ||
// if the root is present from the command line we will use it | ||
// if the root is not present we will look for the Cargo.toml file | ||
// Trdelnik does not have to be already defined to actually create/build | ||
// program client | ||
let root = match root { | ||
Some(r) => r, | ||
_ => { | ||
if let Some(r) = _discover(CARGO_TOML)? { | ||
r | ||
} else { | ||
bail!("It does not seem that Solana Project is initialized because the Cargo.toml file was not found in any parent directory!"); | ||
} | ||
} | ||
}; | ||
let mut generator: TestGenerator = TestGenerator::new_with_root(root); | ||
generator.build().await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
use anyhow::Error; | ||
use anyhow::{bail, Error}; | ||
use fehler::throws; | ||
use trdelnik_client::*; | ||
|
||
use crate::_discover; | ||
|
||
use super::fuzz::TRDELNIK_TOML; | ||
|
||
#[throws] | ||
pub async fn test(root: String) { | ||
pub async fn test(root: Option<String>) { | ||
// if the root is present from the command line we will use it | ||
// if the root is not present we will look for the Trdelnik.toml file | ||
let root = match root { | ||
Some(r) => r, | ||
_ => { | ||
if let Some(r) = _discover(TRDELNIK_TOML)? { | ||
r | ||
} else { | ||
bail!("It does not seem that Trdelnik is initialized because the Cargo.toml file was not found in any parent directory!"); | ||
} | ||
} | ||
}; | ||
let commander = Commander::with_root(root); | ||
commander.run_tests().await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.