1 Commits

Author SHA1 Message Date
e25c27f082 wip 2026-03-23 11:43:22 -05:00
2 changed files with 27 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ use colored::Colorize;
use glob::glob;
const MAIN_C: &str = include_str!("templates/main.c");
const TEST_C: &str = include_str!("templates/it_works.c");
const GITIGNORE: &str = "target/";
#[derive(clap::Parser)]
@@ -53,6 +54,11 @@ enum Subcommand {
#[clap(subcommand)]
command: UtilSubcommand,
},
/// Run tests in your project
Test {
/// The build mode to use
mode: Option<String>,
},
/// List available build modes
List,
}
@@ -157,9 +163,23 @@ impl App {
std::process::exit(1);
}
}
Subcommand::Test { mode } => {
if let Err(e) = test(mode) {
eprintln!("Error running tests: {e}");
std::process::exit(1);
}
}
}
}
}
fn test(mode: Option<String>) -> std::io::Result<()> {
for entry in glob("src/tests/*.c").expect("a valid glob pattern") {
if let Ok(file) = entry {}
}
Ok(())
}
fn list() -> std::io::Result<()> {
let conf = get_config().ok_or(std::io::Error::new(

7
src/templates/it_works.c Normal file
View File

@@ -0,0 +1,7 @@
#include <assert.h>
int main() {
assert((1 + 1) == 2);
return 0;
}