citrun

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

inst_nosrc.t (641B)


      1 #
      2 # Check that giving citrun_inst a non existent file is handled.
      3 #
      4 use Modern::Perl;
      5 use Test::Cmd;
      6 use Test::Differences;
      7 use Test::More tests => 2;
      8 
      9 use lib 't';
     10 require utils;
     11 
     12 
     13 my $inst = Test::Cmd->new( prog => 'inst/citrun_inst', workdir => '' );
     14 
     15 my $out_good = <<EOF;
     16 >> citrun_inst
     17 Compilers path = ''
     18 Found source file ''
     19 Command line is ''
     20 Added clangtool argument ''
     21 EOF
     22 
     23 $inst->run( args => '-c doesnt_exist.c', chdir => $inst->curdir );
     24 
     25 my $out = utils::clean_citrun_log(scalar $inst->stdout);
     26 eq_or_diff( $out,	$out_good,	'citrun_inst output identical' );
     27 print $inst->stderr;
     28 is( $? >> 8,		0,		'citrun_inst exit code 0' );