citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 2b36840a4affeaf52e0b32b5601e11295f0743a0
parent 6ec43a4fd6e134e0a763a48564aa9ab17b1a59e9
Author: Kyle Milz <kyle@windows.krwm.net>
Date:   Mon,  2 Jan 2017 08:34:35 -0800

t: replace wrap_exicode.sh with perl

Diffstat:
Dt/wrap_exitcode.sh | 10----------
At/wrap_exitcode.t | 26++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/t/wrap_exitcode.sh b/t/wrap_exitcode.sh @@ -1,10 +0,0 @@ -#!/bin/sh -u -# -# Make sure that citrun_wrap exits with the same code as the native build. -# -. t/utils.subr -plan 1 - - -output_good="ls: asdfasdfsaf: No such file or directory" -ok_program "build command exit code" 1 "$output_good" citrun_wrap ls asdfasdfsaf diff --git a/t/wrap_exitcode.t b/t/wrap_exitcode.t @@ -0,0 +1,26 @@ +# +# Make sure that citrun_wrap exits with the same code as the native build. +# +use strict; +use warnings; +use Test::Cmd; +use Test::More tests => 3; + +my $wrap = Test::Cmd->new( prog => 'src/citrun_wrap', workdir => '' ); + +if ($^O eq "MSWin32") { + my $err_good = "Cannot access file C:\\Users\\kyle\\citrun\\asdf +"; + $wrap->run( args => 'more.com asdf' ); + + is( $wrap->stdout, '', 'is citrun_wrap stdout empty'); + is( $wrap->stderr, $err_good, 'is citrun_wrap stderr identical'); + is( $? >> 8, 1, 'is citrun_wrap exit code 1'); +} +else { + $wrap->run( args => 'ls asdf' ); + + #is( $wrap->stdout, '', 'is citrun_wrap stdout empty'); + #is( $wrap->stderr, $err_good, 'is citrun_wrap stderr identical'); + is( $? >> 8, 1, 'is citrun_wrap exit code 1'); +}