From d09d38d65b9289e0e8a103004780b03f8d3926b4 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Fri, 9 Dec 2022 14:14:15 +0100 Subject: [PATCH] Add a flag '--skip-tests' to the 'check' cmd. So that tests can be skipped, and the old behavior recovered if necessary. Tests execution is on by default however. --- crates/cli/src/cmd/check.rs | 13 +++++++++++-- crates/project/src/lib.rs | 5 ++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/crates/cli/src/cmd/check.rs b/crates/cli/src/cmd/check.rs index 9f99e617..1bbc1126 100644 --- a/crates/cli/src/cmd/check.rs +++ b/crates/cli/src/cmd/check.rs @@ -6,8 +6,17 @@ pub struct Args { /// Path to project #[clap(short, long)] directory: Option, + + /// Skip tests; run only the type-checker + #[clap(short, long)] + skip_tests: bool, } -pub fn exec(Args { directory }: Args) -> miette::Result<()> { - crate::with_project(directory, |p| p.check()) +pub fn exec( + Args { + directory, + skip_tests, + }: Args, +) -> miette::Result<()> { + crate::with_project(directory, |p| p.check(skip_tests)) } diff --git a/crates/project/src/lib.rs b/crates/project/src/lib.rs index 1875047c..551564af 100644 --- a/crates/project/src/lib.rs +++ b/crates/project/src/lib.rs @@ -95,8 +95,8 @@ where self.compile(true, uplc, false) } - pub fn check(&mut self) -> Result<(), Error> { - self.compile(false, false, true) + pub fn check(&mut self, skip_tests: bool) -> Result<(), Error> { + self.compile(false, false, !skip_tests) } pub fn compile( @@ -119,7 +119,6 @@ where // model the options differently to make it obvious at the type-level. if uplc_gen { let programs = self.code_gen(validators, &checked_modules)?; - self.write_build_outputs(programs, uplc_dump)?; }