commit 69fc49fc29441b4da316e61c1489a5d0ac0fd033
parent 7f3ba824c1690a7421f7fdae1e88c3e91820aa43
Author: Kyle Milz <kyle@0x30.net>
Date: Wed, 10 Aug 2016 00:46:01 -0600
t: use citrun-check in two_src
Diffstat:
M | t/inst_two_src.t | | | 68 | +++++++++++++++++++++++--------------------------------------------- |
1 file changed, 23 insertions(+), 45 deletions(-)
diff --git a/t/inst_two_src.t b/t/inst_two_src.t
@@ -1,5 +1,5 @@
#!/bin/sh -e
-echo 1..5
+echo 1..3
. test/utils.sh
setup
@@ -19,50 +19,28 @@ 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 ''.
-Resource directory is ''
-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 of '' finished:
- 6 Lines of source code
- 32 Lines of instrumentation header
- 1 Functions called ''
- 1 Function definitions
- 1 Return statement values
- 3 Total statements
-Modified source written successfully.
-Instrumentation of '' finished:
- 6 Lines of source code
- 32 Lines of instrumentation header
- 1 Function definitions
- 1 Return statement values
- 3 Total statements
-Modified source written successfully.
-Instrumentation successful.
-Running native compiler on modified source code.
-Forked ''.
-'' exited 0.
-Restored ''.
-Restored ''.
+cat <<EOF > check.good
+Checking ..done
+
+Summary:
+ 1 Log files found
+ 2 Source files input
+ 1 Calls to the instrumentation tool
+ 1 Forked compilers
+ 1 Instrument successes
+ 1 Application link commands
+
+Totals:
+ 12 Lines of source code
+ 64 Lines of instrumentation header
+ 1 Functions called 'main'
+ 2 Function definitions
+ 2 Return statement values
+ 6 Total statements
EOF
-diff -u citrun.log.good citrun.log.proc
-echo "ok 5 - citrun.log diff"
+cc -o main main.c other.c && echo "ok - source compiled"
+citrun-check > check.out
+
+diff -u check.good check.out && echo ok - citrun-check diff