From 685600d72b0c300f94c0c69dc0a16c4ebb230a21 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 2 Jun 2019 11:57:42 +0300 Subject: Rewrite the testsuite The aim is to run pies in foreground if possible. Limit execution time using external wrapper. * src/pies.c: (_cb_redir): Consistently return 1 on errors. * tests/aux/sleepexit: New file. * tests/aux/startcheck: New file. * tests/aux/touchfile: Change arguments. * tests/aux/respawn: Rewrite. * tests/lines.c: New noinst program. * tests/to.c: New noinst program. * tests/.gitignore: Add new programs. * tests/Makefile.am: Update. * tests/env.at: Use to to avoid hanging forever. Add missing popdef. * tests/redirect.at: Use echo as component program. * tests/respawn.at: Run pies in foreground. Use to to limit execution time. * tests/shell.at: Likewise. * tests/shutdown.at: Likewise. * tests/startup.at: Likewise. * tests/ret-exec.at: Use sleepexit as component program. * tests/ret-notify.at: Likewise. --- src/pies.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/pies.c b/src/pies.c index 39467a2..2387cef 100644 --- a/src/pies.c +++ b/src/pies.c @@ -928,14 +928,14 @@ _cb_redir (enum grecs_callback_command cmd, { grecs_error (locus, 0, _("unknown syslog priority %s"), value->v.string); - return 0; + return 1; } break; case GRECS_TYPE_ARRAY: if (assert_grecs_value_type (locus, value->v.arg.v[0], GRECS_TYPE_STRING)) - return 0; + return 1; if (strtotok (redirtab, value->v.arg.v[0]->v.string, &res)) grecs_error (locus, 0, _("%s: unrecognised redirector type"), value->v.arg.v[0]->v.string); @@ -946,11 +946,11 @@ _cb_redir (enum grecs_callback_command cmd, if (value->v.arg.c != 2) { grecs_error (locus, 0, _("wrong number of arguments")); - return 0; + return 1; } if (assert_grecs_value_type (locus, value->v.arg.v[1], GRECS_TYPE_STRING)) - return 0; + return 1; switch (res) { @@ -964,7 +964,7 @@ _cb_redir (enum grecs_callback_command cmd, grecs_error (locus, 0, _("unknown syslog priority %s"), value->v.arg.v[1]->v.string); - return 0; + return 1; } break; -- cgit v1.2.1