aboutsummaryrefslogtreecommitdiff
path: root/make.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-04 12:51:16 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-04 12:51:16 +0200
commit0d9191295e5ee60def97775c8ed672fd882caec2 (patch)
tree41d1c21ee05b097dca6dfc01b8129a5875a91d01 /make.c
parentdb89b40022b0ac464febec6224d820ff0bb64799 (diff)
Add the ‘test’ subcommand
Diffstat (limited to 'make.c')
-rw-r--r--make.c9
1 files 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);