citrun

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

commit 2e92fe7a497753528d7b03d880191feaa39414ba
parent d12537b56374b00f6a7faed0bc704eb55f3d085e
Author: Kyle Milz <kyle@0x30.net>
Date:   Thu, 28 Jul 2016 20:38:58 -0600

t: hang onto tool locations harder

Diffstat:
Mt/inst_nopath.t | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/t/inst_nopath.t b/t/inst_nopath.t @@ -4,17 +4,15 @@ # echo 1..2 tmpfile=`mktemp` + +# Save locations to tools because after unset PATH they are not available. grep=`which grep` +rm=`which rm` unset PATH src/gcc -c nomatter.c 2> $tmpfile -if [ $? -eq 1 ]; then - echo ok 1 -fi - -if $grep -q "PATH must be set" $tmpfile; then - echo ok 2 -fi +[ $? -eq 1 ] && echo ok 1 +$grep -q "PATH must be set" $tmpfile && echo ok 2 -rm $tmpfile +$rm $tmpfile