From 7f870a8a33ed05bd74cfde1f8206f660ce121637 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sun, 12 Jun 2022 10:36:03 -0400 Subject: =?UTF-8?q?Check=20return=20codes=20from=20=E2=80=98system?= =?UTF-8?q?=E2=80=99=20calls.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abort tests if there’s an error during setup. --- t/lib.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 't/lib.t') diff --git a/t/lib.t b/t/lib.t index 657658e..89f4bb7 100644 --- a/t/lib.t +++ b/t/lib.t @@ -13,9 +13,11 @@ BEGIN { deliver => "t/delivert $tmpdir", domains => ['spamcat.example.com', 'spamcat2.example.com']); - system "rm -rf $tmpdir"; + system("rm -rf $tmpdir") == 0 + or die "Couldn't remove ‘$tmpdir’: $!\n"; mkdir $tmpdir; - system "/usr/local/bin/sqlite3 $conf{dbpath} < config/create-tables.sql"; + system("/usr/local/bin/sqlite3 $conf{dbpath} < config/create-tables.sql") == 0 + or die "Couldn't create ‘$conf{dbpath}’: $!\n"; } END { -- cgit v1.2.3