commit 845ff02dca558ec1b7962fdf45678204bb228fef
parent 48b86b8c103c391224efc4eb9fef10d028eeefec
Author: Kyle Milz <kyle@0x30.net>
Date: Mon, 1 Aug 2016 13:43:42 -0600
t: tweak inst_log test
Diffstat:
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/t/inst_log.t b/t/inst_log.t
@@ -6,7 +6,10 @@ tmpdir=`mktemp -d /tmp/citrun.XXXXXXXXXX`
trap "rm -rf $tmpdir" EXIT
echo "ok 1 - tmp dir created"
-cat <<EOF > $tmpdir/source_0.c
+export PATH="`pwd`/src:${PATH}"
+cd $tmpdir
+
+cat <<EOF > source_0.c
#include <stdlib.h>
long long
@@ -26,26 +29,25 @@ main(int argc, char *argv[])
long long n;
n = atoi(argv[1]);
- fibonacci(n);
-
- return 0;
+ return fibonacci(n);
}
EOF
echo "ok 2 - source file wrote"
-cat <<EOF > $tmpdir/Jamfile
+cat <<EOF > Jamfile
Main program : source_0.c ;
EOF
echo "ok 3 - Jamfile wrote"
-export PATH="`pwd`/src:${PATH}"
-cd $tmpdir && jam
-echo "ok 4 - source compiled"
+jam && echo "ok 4 - source compiled"
-cd $tmpdir && sed -e "s,^.*: ,," -e "s,'.*',''," -e "s,(.*),()," < citrun.log > citrun.log.proc
-echo "ok 5 - processed citrun.log"
+sed -e "s,^.*: ,," \
+ -e "s,'.*',''," \
+ -e "s,(.*),()," \
+ < citrun.log > citrun.log.proc \
+ && echo "ok 5 - processed citrun.log"
-cat <<EOF > $tmpdir/citrun.log.good
+cat <<EOF > citrun.log.good
citrun-inst v0.0 () called as ''.
Processing 5 command line arguments.
Found source file ''.
@@ -69,5 +71,4 @@ Forked ''.
Done.
EOF
-cd $tmpdir && diff -u citrun.log.proc citrun.log.good
-echo "ok 6 - diffed processed citrun.log against known good"
+diff -u citrun.log.proc citrun.log.good && echo "ok 6 - citrun.log diff"