mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 23:41:38 +03:00
Test CLI build command
This commit is contained in:
parent
da1419c2ab
commit
c7d3cf96f2
@ -19,6 +19,7 @@ use leo_errors::Result;
|
||||
|
||||
use clap::Parser;
|
||||
use colored::Colorize;
|
||||
use leo_span::symbol::create_session_if_not_set_then;
|
||||
use std::{path::PathBuf, process::exit};
|
||||
|
||||
/// CLI Arguments entry point - includes global parameters and subcommands
|
||||
@ -133,3 +134,35 @@ pub fn run_with_args(cli: CLI) -> Result<()> {
|
||||
Commands::Update { command } => command.try_execute(context),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn build_test() -> Result<()> {
|
||||
const BUILD_DIRECTORY: &str = "utils/tmp/project";
|
||||
|
||||
let cli = CLI {
|
||||
debug: false,
|
||||
quiet: false,
|
||||
command: Commands::Build { command: Build { options: Default::default() } },
|
||||
path: Some(PathBuf::from(BUILD_DIRECTORY)),
|
||||
};
|
||||
create_session_if_not_set_then(|_| {
|
||||
run_with_args(cli).expect("Failed to run build command");
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
#[test]
|
||||
pub fn build_super_simple_test() -> Result<()> {
|
||||
dbg!(std::env::current_dir().expect("TODO: panic message"));
|
||||
const BUILD_DIRECTORY: &str = "utils/tmp/super_simple";
|
||||
|
||||
let cli = CLI {
|
||||
debug: false,
|
||||
quiet: false,
|
||||
command: Commands::Build { command: Build { options: Default::default() } },
|
||||
path: Some(PathBuf::from(BUILD_DIRECTORY)),
|
||||
};
|
||||
create_session_if_not_set_then(|_| {
|
||||
run_with_args(cli).expect("Failed to run build command");
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
@ -42,6 +42,10 @@ version = "0.8"
|
||||
[dependencies.tracing]
|
||||
version = "0.1"
|
||||
|
||||
[dependencies.retriever]
|
||||
path = "../../utils/retriever"
|
||||
version = "0.1"
|
||||
|
||||
[dev-dependencies.lazy_static]
|
||||
version = "1.3.0"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user