Sha256: ab12638ae897af9aba5e26035c3e58fa0bebceda0eb157b3997dd87ff2bf9fe9
Contents?: true
Size: 1.28 KB
Versions: 9
Compression:
Stored size: 1.28 KB
Contents
#!/bin/sh # This file moves all stub files out of the way so that they don't get built, # runs the tests, then moves the stub files back. # We use this instead of build constraints to have less noise in stub files. # Newcomers to go might be confused by build constraints # It's useful to move the stub files back instead of outright deleting them. # That way no maintainer will mistakenly commit the deleted files, # which could otherwise happen after running tests locally. for dir in exercises/*; do stub=$(echo $(basename $dir) | tr - _) file="$dir/$stub.go" if [ -f $file ]; then echo "moving stub $file" mv $file "$dir/$stub.notgo" fi done cleanup () { echo "moving stub files back" # could use `rename` here, but it's not uniform among platforms. # some renames take two arguments while others take a single regex. for file in exercises/*/*.notgo; do dir=$(dirname $file) base=$(basename $file .notgo) mv "$dir/$base.notgo" "$dir/$base.go" done } trap cleanup EXIT INT TERM # This is the last command in the file, # so the exit status of this script is the exit status of go test. # If this ever changes, remember to preserve the exit status acordingly. # Otherwise Travis may falsely report a test as passed when it has failed. go test -cpu 2 $RACE ./...
Version data entries
9 entries across 9 versions & 1 rubygems