e2e_nosrc.t (822B)
1 # 2 # Check that giving citrun_wrap a compile command with a non existent file is 3 # handled. 4 # 5 use Modern::Perl; 6 use Test::Cmd; 7 use Test::Differences; 8 use Test::More tests => 4; 9 10 use lib 't'; 11 require utils; 12 13 my $inst = Test::Cmd->new( prog => 'bin/citrun_wrap', workdir => '' ); 14 15 my $out_good = <<EOF; 16 >> citrun_inst 17 Compilers path = '' 18 PATH = '' 19 Found source file '' 20 EOF 21 22 my $err_good = 'citrun_inst: stat: No such file or directory'; 23 24 $inst->run( args => 'cc -c doesnt_exist.c', chdir => $inst->curdir ); 25 26 my $out; 27 $inst->read( \$out, 'citrun.log' ); 28 $out = utils::clean_citrun_log($out); 29 eq_or_diff( $out, $out_good, 'citrun_wrap output identical' ); 30 31 is( $inst->stdout, '', 'citrun_wrap stdout silent' ); 32 like( $inst->stderr, qr/$err_good/, 'citrun_wrap stderr silent' ); 33 is( $? >> 8, 1, 'citrun_wrap exit code 1' );