commit fec38fabd1808798943595def12a35c6902a8237
parent b037c7a111d60416ff735ad57941c41bbd7a6624
Author: Kyle Milz <kyle@windows.krwm.net>
Date: Tue, 3 Jan 2017 21:08:39 -0800
t: convert wrap_badarg.sh to perl
Diffstat:
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/t/wrap_badarg.sh b/t/wrap_badarg.sh
@@ -1,9 +0,0 @@
-#!/bin/sh -u
-#
-# Make sure calling citrun_wrap with arguments fails.
-#
-. t/utils.subr
-plan 1
-
-output_good="usage: citrun_wrap <build cmd>"
-ok_program "citrun_wrap -ASD" 1 "$output_good" citrun_wrap -ASD
diff --git a/t/wrap_badarg.t b/t/wrap_badarg.t
@@ -0,0 +1,23 @@
+#
+# Make sure calling citrun_wrap with arguments fails.
+#
+use strict;
+use warnings;
+use Test::Cmd;
+use Test::More tests => 3;
+
+my $wrap = Test::Cmd->new( prog => 'citrun_wrap', workdir => '' );
+$wrap->run( args => '-ASD', chdir => $wrap->curdir );
+
+my $err_good;
+if ($^O eq "MSWin32") {
+ $err_good = "'-ASD' is not recognized as an internal or external command,
+operable program or batch file.
+";
+}
+
+is( $wrap->stdout, '', 'is citrun_wrap stdout silent' );
+is( $wrap->stderr, $err_good, 'is citrun_wrap stderr identical' );
+is( $? >> 8, 1, 'is citrun_wrap exit code 1' );
+#output_good="usage: citrun_wrap <build cmd>"
+#ok_program "citrun_wrap -ASD" 1 "$output_good" citrun_wrap -ASD