Loading ptest/src/main.rs +29 −4 Changes for ptest/src/main.rs: 29 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -40,10 +40,6 @@ fn main() -> Result<()> { let args = Cli::parse(); match args.command { Commands::Run => (), } let workflow_text = fs::read_to_string(&args.workflow)?; let workflow = YamlLoader::load_from_str(&workflow_text)?; Loading @@ -52,6 +48,14 @@ fn main() -> Result<()> { let matrix = Matrix::from_yaml(&workflow); match args.command { Commands::List => { matrix.show(); return Ok(()); } Commands::Run => (), } let mut children = vec![]; let state = State::new(matrix.envs.len()); let st2 = state.clone(); Loading Loading @@ -100,6 +104,8 @@ struct Cli { enum Commands { /// Runs the tests. Run, /// List available tests. List, } /// State, for printing status. Loading Loading @@ -246,6 +252,13 @@ impl Matrix { envs, } } /// Print out all of the feature sets. fn show(&self) { for (i, feature) in self.envs.iter().enumerate() { println!("{:3}. {}", i, feature.simple_textual()); } } } impl FeatureSet { Loading Loading @@ -304,6 +317,18 @@ impl FeatureSet { buf } /// Generate a simpler textual representation, without showing the environment. fn simple_textual(&self) -> String { use std::fmt::Write; let mut buf = String::new(); for v in &self.values { write!(&mut buf, " {}", v).unwrap(); } buf } } fn lookup_matrix(y: &Yaml) -> Option<&Vec<Yaml>> { Loading Loading
ptest/src/main.rs +29 −4 Changes for ptest/src/main.rs: 29 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -40,10 +40,6 @@ fn main() -> Result<()> { let args = Cli::parse(); match args.command { Commands::Run => (), } let workflow_text = fs::read_to_string(&args.workflow)?; let workflow = YamlLoader::load_from_str(&workflow_text)?; Loading @@ -52,6 +48,14 @@ fn main() -> Result<()> { let matrix = Matrix::from_yaml(&workflow); match args.command { Commands::List => { matrix.show(); return Ok(()); } Commands::Run => (), } let mut children = vec![]; let state = State::new(matrix.envs.len()); let st2 = state.clone(); Loading Loading @@ -100,6 +104,8 @@ struct Cli { enum Commands { /// Runs the tests. Run, /// List available tests. List, } /// State, for printing status. Loading Loading @@ -246,6 +252,13 @@ impl Matrix { envs, } } /// Print out all of the feature sets. fn show(&self) { for (i, feature) in self.envs.iter().enumerate() { println!("{:3}. {}", i, feature.simple_textual()); } } } impl FeatureSet { Loading Loading @@ -304,6 +317,18 @@ impl FeatureSet { buf } /// Generate a simpler textual representation, without showing the environment. fn simple_textual(&self) -> String { use std::fmt::Write; let mut buf = String::new(); for v in &self.values { write!(&mut buf, " {}", v).unwrap(); } buf } } fn lookup_matrix(y: &Yaml) -> Option<&Vec<Yaml>> { Loading