citrun

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

commit b5c444fd4b523bc524d5531dfbcc2d8ec3dedd2b
parent 64685f70aa2c9553c791cba181a8164ae3e305de
Author: Kyle Milz <kyle@0x30.net>
Date:   Fri,  5 Aug 2016 15:35:17 -0600

t: add test for two source files on one command line.

Diffstat:
At/inst_two_src_one_cmd.t | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+), 0 deletions(-)

diff --git a/t/inst_two_src_one_cmd.t b/t/inst_two_src_one_cmd.t @@ -0,0 +1,57 @@ +#!/bin/sh -e + +echo "1..5" + +tmpdir=`mktemp -d /tmp/citrun.XXXXXXXXXX` +trap "rm -rf $tmpdir" EXIT +echo "ok 1 - tmp dir created" + +export PATH="`pwd`/src:${PATH}" +cd $tmpdir + +cat <<EOF > main.c +int +main(void) +{ + return 0; +} +EOF + +cat <<EOF > other.c +int +other(void) +{ + return 0; +} +EOF +echo "ok 2 - source files wrote" + +cc -o main main.c other.c +echo "ok 3 - source compiled" + +sed -e "s,^.*: ,," \ + -e "s,'.*',''," \ + -e "s,(.*),()," \ + < citrun.log > citrun.log.proc +echo "ok 4 - processed citrun.log" + +cat <<EOF > citrun.log.good + +citrun-inst v0.0 () called as ''. +PATH='' +Command line is ''. +Found source file ''. +Found source file ''. +Object arg = 1, compile arg = 0 +Link detected, adding '' to command line. +Added clangtool argument ''. +Instrumentation successful. +Running native compiler on modified source code. +Forked ''. +'' exited 0. +Restored ''. +Restored ''. +EOF + +diff -u citrun.log.good citrun.log.proc +echo "ok 5 - citrun.log diff"