citrun

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

commit 41d04c825b88a0b73962afab87b5a27bf537990a
parent 8817305ae50c3b57bebf11ecc75300cbdf48a129
Author: Kyle Milz <kyle@0x30.net>
Date:   Wed, 10 Aug 2016 00:10:26 -0600

t: improve multi source test

Diffstat:
At/inst_link_multiple.t | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dt/inst_multi_source.t | 46----------------------------------------------
2 files changed, 65 insertions(+), 46 deletions(-)

diff --git a/t/inst_link_multiple.t b/t/inst_link_multiple.t @@ -0,0 +1,65 @@ +#!/bin/sh +echo 1..4 + +. test/utils.sh +setup + +cat <<EOF > one.c +void second_func(); + +int +main(void) +{ + second_func(); + return 0; +} +EOF + +cat <<EOF > two.c +void third_func(); + +void +second_func(void) +{ + third_func(); + return; +} +EOF + +cat <<EOF > three.c +void +third_func(void) +{ + return; +} +EOF + +cat <<EOF > Jamfile +Main program : one.c two.c three.c ; +EOF + +jam && echo "ok - source compiled" + +citrun-check > check.out && echo ok + +cat <<EOF > check.good +Checking ..done + +Summary: + 3 Source files input + 4 Calls to the instrumentation tool + 3 Forked compilers + 3 Instrument successes + 1 Application link commands + +Totals: + 24 Lines of source code + 96 Lines of instrumentation header + 1 Functions called 'main' + 3 Function definitions + 1 Return statement values + 2 Call expressions + 13 Total statements +EOF + +diff -u check.good check.out && echo ok diff --git a/t/inst_multi_source.t b/t/inst_multi_source.t @@ -1,46 +0,0 @@ -use strict; -use Test::More tests => 1; -use Test::Project; -use Test::Viewer; - -my $project = Test::Project->new(); -my $viewer = Test::Viewer->new(); - -$project->add_src(<<EOF -void second_func(); - -int -main(void) -{ - second_func(); - return 0; -} -EOF -); - -$project->add_src(<<EOF -void third_func(); - -void -second_func(void) -{ - third_func(); - return; -} -EOF -); - -$project->add_src(<<EOF -void -third_func(void) -{ - return; -} -EOF -); - -$project->compile(); -$project->run(); - -my ($ret, $err) = $project->wait(); -is($ret, 0, "instrumented program check return code");