diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-08-14 10:48:26 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-09-07 17:32:20 +0100 |
commit | d5c69db746b5c4ba938248a7d1c285256c6e6412 (patch) | |
tree | c0945c1eba87cc2702ea574a94c5cfa5ae61762c /src/bin/subplot.rs | |
parent | 4436b7ee28b0318a96d98833d85d712c8a18850d (diff) | |
download | subplot-d5c69db746b5c4ba938248a7d1c285256c6e6412.tar.gz |
subplot: Properly support polyglot bindings
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r-- | src/bin/subplot.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs index 22eda3b..034cbb2 100644 --- a/src/bin/subplot.rs +++ b/src/bin/subplot.rs @@ -310,7 +310,9 @@ impl Docgen { } let mut doc = cli::load_document(&self.input, style)?; doc.lint()?; - if !doc.check_named_files_exist()? { + let template = doc.meta().template_name().unwrap_or("").to_string(); + if !doc.check_named_files_exist(&template)? || !doc.check_matched_steps_have_impl(&template) + { eprintln!("Continuing despite warnings"); } @@ -408,17 +410,18 @@ impl Codegen { let _enter = span.enter(); let mut doc = cli::load_document(&self.filename, Style::default())?; doc.lint()?; - if !doc.check_named_files_exist()? { - eprintln!("Unable to continue"); - std::process::exit(1); - } - - let spec = template_spec(&doc)?; let template = doc .meta() .template_name() .ok_or_else(|| anyhow::anyhow!("No template name given"))? .to_string(); + if !doc.check_named_files_exist(&template)? || !doc.check_matched_steps_have_impl(&template) + { + eprintln!("Unable to continue"); + std::process::exit(1); + } + + let spec = template_spec(&doc)?; generate_test_program(&mut doc, &spec, &self.output, &template)?; if self.run { |