commit ac5a0a4fe627e6da01029b77a3e112704cd4be26
parent de517a8a5e5c9ce6f84198520aa332b01d295426
Author: Kyle Milz <kyle@0x30.net>
Date: Thu, 29 Dec 2016 17:26:40 -0700
t: convert check_empty.sh to perl
Diffstat:
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/t/check_empty.sh b/t/check_empty.sh
@@ -1,11 +0,0 @@
-#!/bin/sh -u
-#
-# Verify the output when 0 citrun.log files are found.
-#
-. t/utils.subr
-plan 1
-
-
-output_good="Summary:
- 0 Source files used as input"
-ok_program "is no logs found message printed" 123 "$output_good" citrun_check
diff --git a/t/check_empty.t b/t/check_empty.t
@@ -0,0 +1,18 @@
+#
+# Verify the output when 0 citrun.log files are found.
+#
+use strict;
+use warnings;
+use Test::Cmd;
+use Test::More tests => 3;
+
+my $output_good = "Summary:
+ 0 Source files used as input
+";
+
+my $check = Test::Cmd->new( prog => 'src/citrun_check', workdir => '' );
+$check->run( chdir => $check->curdir );
+
+is( $check->stdout, $output_good, 'is citrun_check stdout identical' );
+is( $check->stderr, '', 'is citrun_check stderr empty' );
+is( $? >> 8, 123, 'is citrun_check exit code 123' );