# !/bin/bash
#
# lin-build

DEVEL=$HOME/devel
NEXTHOP=$DEVEL/nexthop
export GOPATH=$NEXTHOP

PATH=$NEXTHOP/bin:$PATH

src="addr bgp cli command fwd netorder rib rib-old rip sample sock telnet tools"
unu="addr bgp cli command fwd netorder rib rib-old rip        sock telnet tools/rip-query"

for i in $src; do
    j=$NEXTHOP/src/$i
    echo $j
    go tool fix $j
    go tool vet $j
    gofmt -s -w $j
    gosimple $i
    #golint $j     ;# golint is verbose, enable only when actually needed
done

unused $unu ;# unused is slow

go install rib-old rib rip bgp tools/rip-query

save=$PWD
cd $NEXTHOP
test_dirs=`ls src/*/*_test.go | awk -F/ '{ print $2 }'`
cd $save

go test $test_dirs

# eof

# !/bin/bash
#
# lin-build

DEVEL=$HOME/devel
NEXTHOP=$DEVEL/nexthop
export GOPATH=$NEXTHOP

PATH=$NEXTHOP/bin:$PATH

src="addr bgp cli command fwd netorder rib rib-old rip sample sock telnet tools"
unu="addr bgp cli command fwd netorder rib rib-old rip        sock telnet tools/rip-query"

for i in $src; do
    j=$NEXTHOP/src/$i
    echo $j
    go tool fix $j
    go tool vet $j
    gofmt -s -w $j
    gosimple $i
    #golint $j     ;# golint is verbose, enable only when actually needed
done

unused $unu ;# unused is slow

go install rib-old rib rip bgp tools/rip-query

go test bgp command cli addr sock rip netorder

# eof

--- 
+++ 
@@ -25,6 +25,11 @@
 
 go install rib-old rib rip bgp tools/rip-query
 
-go test bgp command cli addr sock rip netorder
+save=$PWD
+cd $NEXTHOP
+test_dirs=`ls src/*/*_test.go | awk -F/ '{ print $2 }'`
+cd $save
+
+go test $test_dirs
 
 # eof
Test all packages with test cases.
