diff --git a/tests/check0.sh b/tests/check0.sh index 2487107..2d24e84 100755 --- a/tests/check0.sh +++ b/tests/check0.sh @@ -5,6 +5,11 @@ SINDEX=0 STERM=main STYPE="find C symbol" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -15,7 +20,7 @@ rm -f cscope.out #Count the number of instances of the string 'Copyright' #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check1.sh b/tests/check1.sh index a80997b..4b45f9d 100755 --- a/tests/check1.sh +++ b/tests/check1.sh @@ -5,6 +5,11 @@ SINDEX=1 STERM=main STYPE="symbol definition" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -15,7 +20,7 @@ rm -f cscope.out #Count the number of instances of the string 'Copyright' #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check2.sh b/tests/check2.sh index efbf2e5..4455215 100755 --- a/tests/check2.sh +++ b/tests/check2.sh @@ -5,6 +5,11 @@ SINDEX=2 STERM=build STYPE="functions called by" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -13,7 +18,7 @@ cd .. #Remove any previous databases from testing rm -f cscope.out -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check3.sh b/tests/check3.sh index 5ec8fc0..e28d7cf 100755 --- a/tests/check3.sh +++ b/tests/check3.sh @@ -5,6 +5,11 @@ SINDEX=3 STERM=printf STYPE="functions calling" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -14,7 +19,7 @@ cd .. rm -f cscope.out #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check4.sh b/tests/check4.sh index 5a58d59..9ef2ee5 100755 --- a/tests/check4.sh +++ b/tests/check4.sh @@ -4,6 +4,11 @@ SINDEX=4 STERM=oldsigquit STYPE="regular text string" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -12,7 +17,7 @@ cd .. #Remove any previous databases from testing rm -f cscope.out -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check6.sh b/tests/check6.sh index b13b33e..dcf0f8b 100755 --- a/tests/check6.sh +++ b/tests/check6.sh @@ -5,6 +5,11 @@ SINDEX=6 STERM=msg.*what STYPE="egrep string" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -15,7 +20,7 @@ rm -f cscope.out #Count the number of instances of the string 'Copyright' #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check7.sh b/tests/check7.sh index 3dc0706..e49b3b4 100755 --- a/tests/check7.sh +++ b/tests/check7.sh @@ -5,6 +5,11 @@ SINDEX=7 STERM=main.c STYPE="file named" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -15,7 +20,7 @@ rm -f cscope.out #Count the number of instances of the string 'Copyright' #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check8.sh b/tests/check8.sh index d03a73a..d82b549 100755 --- a/tests/check8.sh +++ b/tests/check8.sh @@ -5,6 +5,11 @@ SINDEX=8 STERM=unistd.h STYPE="files including this file" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -15,7 +20,7 @@ rm -f cscope.out #Count the number of instances of the string 'Copyright' #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then diff --git a/tests/check9.sh b/tests/check9.sh index 87f59f3..6e3a178 100755 --- a/tests/check9.sh +++ b/tests/check9.sh @@ -5,6 +5,11 @@ SINDEX=9 STERM=reftime STYPE="assignments to symbol" +if [ -z "$CSCOPE_BINARY" ] +then + CSCOPE_BINARY=./src/cscope +fi + echo "Searching item $SINDEX, '$STYPE'" #Get to the top level directory @@ -15,7 +20,7 @@ rm -f cscope.out #Count the number of instances of the string 'Copyright' #We expect 178 currently -COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) +COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) if [ $COUNT -ne $EXPECT ] then