github.com/golang/dep@v0.5.4/hack/test.bash (about)

     1  #!/usr/bin/env bash
     2  # Copyright 2017 The Go Authors. All rights reserved.
     3  # Use of this source code is governed by a BSD-style
     4  # license that can be found in the LICENSE file.
     5  #
     6  # This script will build dep and calculate hash for each
     7  # (DEP_BUILD_PLATFORMS, DEP_BUILD_ARCHS) pair.
     8  # DEP_BUILD_PLATFORMS="linux" DEP_BUILD_ARCHS="amd64" ./hack/build-all.bash
     9  # can be called to build only for linux-amd64
    10  
    11  set -e
    12  
    13  IMPORT_DURING_SOLVE=${IMPORT_DURING_SOLVE:-false}
    14  
    15  go test -timeout=300s -race \
    16      -ldflags '-X github.com/golang/dep/cmd/dep.flagImportDuringSolve=${IMPORT_DURING_SOLVE}' \
    17      ./...
    18  
    19  if ! ./dep status -out .dep.status.file.output; then exit 1; fi
    20  if ! ./dep status > .dep.status.stdout.output; then
    21     rm -f .dep.status.file.output
    22     exit 1
    23  fi
    24  if ! diff .dep.status.file.output .dep.status.stdout.output; then
    25    diffResult=1
    26  else
    27    diffResult=0
    28  fi
    29  rm -f .dep.status.file.output .dep.status.stdout.output
    30  if [ "$diffResult" -eq "1" ]; then
    31    exit 1
    32  fi