From 0d9191295e5ee60def97775c8ed672fd882caec2 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 4 May 2024 12:51:16 +0200 Subject: Add the ‘test’ subcommand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- make.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make.c b/make.c index 5e0e0ff..981ffed 100644 --- a/make.c +++ b/make.c @@ -61,7 +61,10 @@ main(int argc, char **argv) while ((opt = getopt(argc, argv, "fj:r")) != -1) { switch (opt) { case '?': - fprintf(stderr, "Usage: %s [-j procs] [-fr]\n", *argv); + fprintf(stderr, + "Usage: %s [-j procs] [-fr]\n" + " %s clean | gen | test\n", + *argv, *argv); exit(EXIT_FAILURE); case 'j': procs = atoi(optarg); @@ -83,7 +86,9 @@ main(int argc, char **argv) cmdadd(&c, "find", "gen", "-mindepth", "2", "-type", "f", "-executable", "-not", "(", "-name", "scale", "-or", "-name", "bool-props.py", ")", "-exec", "{}", ";"); - } else + } else if (streq(*argv, "test")) + cmdadd(&c, "./test/run-tests"); + else diex("invalid subcommand — ‘%s’", *argv); cmdput(c); CMDRC(c); -- cgit v1.2.3