citrun

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

commit 03b52c91db0fa0d104108f0a0503608a62a8d0ed
parent a969ce4a8d9ed6eb1229bf9923d6710030e7aef7
Author: Kyle Milz <kyle@0x30.net>
Date:   Mon,  9 Oct 2017 22:30:15 -0600

t: small misc test improvements

Diffstat:
Mt/inst_binop.t | 8+++++---
Mt/inst_path.t | 3++-
Mt/lib_size.t | 1+
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/t/inst_binop.t b/t/inst_binop.t @@ -3,10 +3,12 @@ # use Modern::Perl; use t::utils; + plan tests => 4; my $inst = Test::Cmd->new( prog => 'bin/citrun_inst', workdir => '' ); + $inst->write( 'binop.c', <<EOF ); enum ASDF { ONE = (1 << 0), @@ -48,7 +50,7 @@ int main(void) {++_citrun.data[13]; } EOF -my $check_good = <<EOF; +my $log_good = <<EOF; >> citrun_inst Compilers path = '' Found source file '' @@ -72,9 +74,9 @@ my $inst_out; $inst->read(\$inst_out, 'binop.c'); # Sanitize paths from stdout. -my $check_out = clean_citrun_log(scalar $inst->stdout); +my $log_out = clean_citrun_log(scalar $inst->stdout); eq_or_diff( $inst_out, $inst_good, 'is instrumented file identical', { context => 3 } ); -eq_or_diff $check_out, $check_good, 'is citrun_inst output identical', { context => 3 }; +eq_or_diff $log_out, $log_good, 'is citrun_inst output identical', { context => 3 }; is( $inst->stderr, '', 'is citrun_inst stderr silent' ); is( $? >> 8, 0, 'is citrun_inst exit code 0' ); diff --git a/t/inst_path.t b/t/inst_path.t @@ -5,6 +5,7 @@ # use Modern::Perl; use t::utils; + plan tests => 4; @@ -17,7 +18,7 @@ my $error_good = "Error: '.*share/citrun' not in PATH."; $cc->run( args => '', chdir => $cc->curdir ); is( $cc->stdout, '', 'is cc stdout empty' ); -like( $cc->stderr, qr/$error_good/, 'is cc stderr identical' ); +like( $cc->stderr, qr/$error_good/, 'is cc stderr about right' ); is( $? >> 8, 1, 'is cc exit code 1' ); my $log_out; diff --git a/t/lib_size.t b/t/lib_size.t @@ -4,6 +4,7 @@ use Modern::Perl; use t::mem; use t::utils; + plan tests => 6;