github.com/rakutentech/cli@v6.12.5-0.20151006231303-24468b65536e+incompatible/bin/test (about)

     1  #!/bin/bash
     2  
     3  (
     4    set -e
     5  
     6    function printStatus {
     7        if [ $? -eq 0 ]; then
     8            echo -e "\nSWEET SUITE SUCCESS"
     9        else
    10            echo -e "\nSUITE FAILURE"
    11        fi
    12    }
    13  
    14    trap printStatus EXIT
    15  
    16    bin/generate-language-resources
    17  
    18    echo -e "\n Running gi18n checkup..."
    19    bin/gi18n-checkup
    20  
    21    go get github.com/tools/godep
    22  
    23    GODEP=$(which godep)
    24  
    25    echo -e "\n Cleaning build artifacts..."
    26  
    27    # Clean up old plugin binaries used in test
    28  
    29    rm -f fixtures/plugins/*.exe
    30    rm -f plugin_examples/*.exe
    31  
    32    # Clean up old .a files in GOPATH
    33    # It seems like `go clean` should do this but ... not so much
    34    if [[ -d $GOPATH/pkg ]] ; then
    35      pushd $GOPATH/pkg
    36      rm -Rf *
    37      popd
    38    fi
    39  
    40    if [[ -d $($GODEP path)/pkg ]] ; then
    41      pushd $($GODEP path)/pkg
    42      rm -Rf *
    43      popd
    44    fi
    45  
    46    export LC_ALL="en_US.UTF-8"
    47    export GOPATH=$($GODEP path):$GOPATH
    48    export PATH=$($GODEP path)/bin:$PATH
    49    go install github.com/onsi/ginkgo/ginkgo
    50  
    51    echo -e "\n Formatting packages..."
    52    go fmt ./...
    53  
    54    echo -e "\n Verifying total commands registered..."
    55    ginkgo commands_loader 
    56    
    57    echo -e "\n Testing packages..."
    58    CF_HOME=$(pwd)/fixtures ginkgo -r $@
    59  
    60    echo -e "\n Vetting packages for potential issues..."
    61    go tool vet cf/.
    62    for file in $(find {cf,fileutils,generic,glob,main,testhelpers,words} \( -name "*.go" -not -iname "*test.go" \))
    63    do
    64      go tool vet -all -shadow=true $file
    65    done
    66  
    67    echo -e "\n Running build script to confirm everything compiles..."
    68    bin/build
    69  )