test: Improve test depth
Make sure we're catching everything, including new, deeper code.
This commit is contained in:
@@ -22,7 +22,7 @@ ln -s "$linkto" # symlink outside of dir
|
||||
cd `basename "$linkto"`
|
||||
|
||||
# loop through individual *.go files in working dir
|
||||
for file in `find . -maxdepth 3 -type f -name '*.go'`; do
|
||||
for file in `find . -maxdepth 9 -type f -name '*.go'`; do
|
||||
#echo "running test on: $file"
|
||||
run-test go build -i -o "$buildout" "$file" || fail_test "could not build: $file"
|
||||
done
|
||||
|
||||
@@ -27,7 +27,7 @@ if [ "$COMMITS" != "" ] && [ "$COMMITS" -gt "1" ]; then
|
||||
fi
|
||||
|
||||
# find all go files, exluding temporary directories and generated files
|
||||
LINT=$(find * -maxdepth 5 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/y.go' -not -path 'lang/lexer.nn.go' -not -path 'vendor/*' -exec golint {} \;) # current golint output
|
||||
LINT=$(find * -maxdepth 9 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/y.go' -not -path 'lang/lexer.nn.go' -not -path 'vendor/*' -exec golint {} \;) # current golint output
|
||||
|
||||
COUNT=`echo -e "$LINT" | wc -l` # number of golint problems in current branch
|
||||
[ "$LINT" = "" ] && echo PASS && exit # everything is "perfect"
|
||||
@@ -55,7 +55,7 @@ while read -r line; do
|
||||
done <<< "$NUMSTAT1" # three < is the secret to putting a variable into read
|
||||
|
||||
git checkout "$PREVIOUS" &>/dev/null # previous commit
|
||||
LINT1=$(find * -maxdepth 5 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/y.go' -not -path 'lang/lexer.nn.go' -not -path 'vendor/*' -exec golint {} \;)
|
||||
LINT1=$(find * -maxdepth 9 -iname '*.go' -not -path 'old/*' -not -path 'tmp/*' -not -path 'bindata/*' -not -path 'lang/y.go' -not -path 'lang/lexer.nn.go' -not -path 'vendor/*' -exec golint {} \;)
|
||||
COUNT1=`echo -e "$LINT1" | wc -l` # number of golint problems in older branch
|
||||
|
||||
# clean up
|
||||
|
||||
@@ -54,7 +54,7 @@ echo "Using: $gometalinter"
|
||||
|
||||
# loop through directories in an attempt to scan each go package
|
||||
# TODO: lint the *.go examples as individual files and not as a single *.go
|
||||
for dir in `find * -maxdepth 5 -type d -not -path 'old/*' -not -path 'old' -not -path 'tmp/*' -not -path 'tmp' -not -path 'vendor/*' -not -path 'examples/*' -not -path 'test/*'`; do
|
||||
for dir in `find * -maxdepth 9 -type d -not -path 'old/*' -not -path 'old' -not -path 'tmp/*' -not -path 'tmp' -not -path 'vendor/*' -not -path 'examples/*' -not -path 'test/*'`; do
|
||||
#echo "Running in: $dir"
|
||||
|
||||
match="$dir/*.go"
|
||||
|
||||
@@ -75,7 +75,10 @@ for pkg in `go list -e ./... | grep -v "^${base}/vendor/" | grep -v "^${base}/ex
|
||||
done
|
||||
|
||||
# loop through individual *.go files
|
||||
for file in `find . -maxdepth 3 -type f -name '*.go' -not -path './old/*' -not -path './tmp/*'`; do
|
||||
for file in `find . -maxdepth 9 -type f -name '*.go' -not -path './old/*' -not -path './tmp/*' -not -path 'vendor/*'`; do
|
||||
#if [[ $file == "./vendor/"* ]]; then # skip files that start with...
|
||||
# continue
|
||||
#fi
|
||||
run-test grep 'log.Print' "$file" | grep '\\n"' && fail_test 'no newline needed in log.Print*()' # no \n needed in log.Printf or log.Println
|
||||
run-test simplify-gocase "$file"
|
||||
run-test token-coloncheck "$file"
|
||||
|
||||
@@ -39,7 +39,7 @@ function parser-conflicts() {
|
||||
}
|
||||
|
||||
# loop through individual *.y files
|
||||
for file in `find . -maxdepth 3 -type f -name '*.y' -not -path './old/*' -not -path './tmp/*'`; do
|
||||
for file in `find . -maxdepth 9 -type f -name '*.y' -not -path './old/*' -not -path './tmp/*' -not -path 'vendor/*'`; do
|
||||
run-test parser-indentation "$file"
|
||||
run-test parser-conflicts "$file"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user