Local runner for GitHub autograder
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Specify default for `ComparisonType`

Ben C 2a7829c1 84669c77

+4 -5
+2 -1
src/grader.rs
··· 7 7 8 8 const AUTO_GRADER_DEFAULT_PATH: &str = ".github/classroom/autograding.json"; 9 9 10 - #[derive(Deserialize)] 10 + #[derive(Deserialize, Default)] 11 11 #[serde(rename_all = "snake_case")] 12 12 pub enum ComparisonType { 13 + #[default] 13 14 Included, 14 15 Excluded, 15 16 Regex,
+2 -4
src/runner.rs
··· 1 1 use std::{ 2 - env, 3 2 io::{Read, Write}, 4 3 process::{Command, Stdio}, 5 4 time::Duration, ··· 40 39 } 41 40 42 41 pub fn run_phase(cmd: &str, input: &str, timeout: u64) -> Result<TestResult> { 43 - let shell = env::var("SHELL").map_err(|_| anyhow!("SHELL environment variable not set"))?; 44 - let mut child = Command::new(shell) 42 + let mut child = Command::new("bash") 45 43 .arg("-c") 46 44 .arg(cmd) 47 45 .stdin(Stdio::piped()) ··· 57 55 58 56 write!(stdin, "{input}").map_err(|e| anyhow!("Failed to write to stdin: {e:?}"))?; 59 57 60 - let duration = Duration::from_secs(timeout); 58 + let duration = Duration::from_secs(timeout * 60); 61 59 62 60 let res = child.wait_timeout(duration); 63 61