commit 91cfe5caf039ad3594593da62f95277c005ad404 from: Omar Polo date: Fri Aug 06 14:17:03 2021 UTC gracefully handle empty tests and procs commit - f3289b7eab31bc5780db03c4b54a04d066863493 commit + 91cfe5caf039ad3594593da62f95277c005ad404 blob - 61faea94872fdd06f33f7b56e8952074df6274fb blob + 12800df3f542b3f695c5cdca26cdc6b5d696ccf4 --- script.c +++ script.c @@ -731,6 +731,13 @@ eval(struct op *op) != EVAL_OK) return ret; } else { + if (proc->body == NULL) { + before_printing(); + printf("warn: calling the empty proc `%s'\n", + proc->name); + break; + } + pushenv(); for (t = op->v.funcall.argv, i = 0; @@ -1023,6 +1030,12 @@ run_test(struct test *t) puts("====================="); #endif + if (t->body == NULL) { + before_printing(); + printf("no instructions, skipping...\n"); + return EVAL_SKIP; + } + return eval(t->body); }