citrun

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

wrap_exitcode.t (569B)


      1 #
      2 # Make sure that citrun_wrap exits with the same code as the native build.
      3 #
      4 use Modern::Perl;
      5 use Test::Cmd;
      6 use Test::More tests => 3;
      7 
      8 
      9 my $wrap = Test::Cmd->new( prog => 'bin/citrun_wrap', workdir => '' );
     10 
     11 my $e;
     12 if ($^O eq "MSWin32") {
     13 	$wrap->run( args => 'more.com asdf' );
     14 	$e = 'Cannot access file .*asdf';
     15 }
     16 else {
     17 	$wrap->run( args => 'ls asdf' );
     18 	$e = "ls: asdf: No such file or directory";
     19 }
     20 
     21 is( $wrap->stdout,	'',	'citrun_wrap stdout empty');
     22 like( $wrap->stderr,	qr/$e/,	'citrun_wrap stderr identical');
     23 is( $? >> 8,		1,	'citrun_wrap exit code 1');