You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.3 KiB

  1. #! /bin/bash
  2. # set glide.lock path
  3. if [[ "$GLIDE" == "" ]]; then
  4. GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
  5. fi
  6. # get vendored commit for given lib
  7. function parseGlide() {
  8. cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}'
  9. }
  10. # fetch and checkout vendored dep
  11. function getDep() {
  12. lib=$1
  13. echo "----------------------------------"
  14. echo "Getting $lib ..."
  15. go get -t github.com/tendermint/$lib/...
  16. VENDORED=$(parseGlide $GLIDE $lib)
  17. cd $GOPATH/src/github.com/tendermint/$lib
  18. MASTER=$(git rev-parse origin/master)
  19. if [[ "$VENDORED" != "$MASTER" ]]; then
  20. echo "... VENDORED != MASTER ($VENDORED != $MASTER)"
  21. echo "... Checking out commit $VENDORED"
  22. git checkout $VENDORED &> /dev/null
  23. fi
  24. }
  25. ####################
  26. # libs we depend on
  27. ####################
  28. LIBS_GO_TEST=(go-clist go-common go-config go-crypto go-db go-events go-merkle go-p2p)
  29. LIBS_MAKE_TEST=(go-rpc go-wire tmsp)
  30. for lib in "${LIBS_GO_TEST[@]}"; do
  31. getDep $lib
  32. echo "Testing $lib ..."
  33. go test --race github.com/tendermint/$lib/...
  34. if [[ "$?" != 0 ]]; then
  35. echo "FAIL"
  36. exit 1
  37. fi
  38. done
  39. for lib in "${LIBS_MAKE_TEST[@]}"; do
  40. getDep $lib
  41. echo "Testing $lib ..."
  42. cd $GOPATH/src/github.com/tendermint/$lib
  43. make test
  44. if [[ "$?" != 0 ]]; then
  45. echo "FAIL"
  46. exit 1
  47. fi
  48. done
  49. echo ""
  50. echo "PASS"