citrun

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

inst_path.t (872B)


      1 #
      2 # Test that:
      3 # - TODO: not having PATH set errors
      4 # - not having CITRUN_PATH set when using transparent compile mode errors
      5 #
      6 use Modern::Perl;
      7 use Test::Cmd;
      8 use Test::Differences;
      9 use Test::More tests => 4;
     10 
     11 use lib 't';
     12 require utils;
     13 
     14 
     15 my $compiler = 'share/cc';
     16 $compiler = 'compilers\cl' if ($^O eq 'MSWin32');
     17 
     18 my $cc = Test::Cmd->new( prog => $compiler, workdir => '' );
     19 
     20 my $error_good = "Error: '.*share' not in PATH.";
     21 
     22 $cc->run( args => '', chdir => $cc->curdir );
     23 is( $cc->stdout,	'',			'is cc stdout empty' );
     24 like( $cc->stderr,	qr/$error_good/,	'is cc stderr about right' );
     25 is( $? >> 8,		1,			'is cc exit code 1' );
     26 
     27 my $log_out;
     28 $cc->read( \$log_out, 'citrun.log' );
     29 
     30 my $log_good = <<EOF;
     31 >> citrun_inst
     32 Compilers path = ''
     33 PATH = ''
     34 Error: '' not in PATH.
     35 EOF
     36 
     37 eq_or_diff( utils::clean_citrun_log( $log_out ), $log_good,
     38 	'is citrun.log identical' );