-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ISC License | ||
|
||
Copyright (c) 2013-2017 The btcsuite developers | ||
Copyright (c) 2015-2020 The Decred developers | ||
Copyright (c) 2017 The Lightning Network Developers | ||
|
||
Permission to use, copy, modify, and distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Decred Binary Test Modules | ||
|
||
This repository contains Go modules to write automated test scenarios involving | ||
binaries for the [Decred](https://github.com/decred) project. | ||
|
||
This is a work in progress repository. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package dcrtest | ||
|
||
import ( | ||
_ "github.com/decred/dcrtest/dcrdtest" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module github.com/decred/dcrtest | ||
|
||
go 1.18 | ||
|
||
require github.com/decred/dcrtest/dcrdtest v0.0.0-20221116180444-ea39cd8240db | ||
|
||
replace github.com/decred/dcrdtest => ./dcrdtest | ||
|
||
replace ( | ||
github.com/decred/dcrd/blockchain/stake/v5 => github.com/decred/dcrd/blockchain/stake/v5 v5.0.0-20221022042529-0a0cc3b3bf92 | ||
github.com/decred/dcrd/gcs/v4 => github.com/decred/dcrd/gcs/v4 v4.0.0-20221022042529-0a0cc3b3bf92 | ||
github.com/decred/dcrd/rpc/jsonrpc/types/v4 => github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.0.0-20221022042529-0a0cc3b3bf92 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/decred/dcrtest/dcrdtest v0.0.0-20221116180444-ea39cd8240db h1:cZvJgqcqYsaJSqlNqUOyzJ1wyNddeimkyIbStXUKQ4c= | ||
github.com/decred/dcrtest/dcrdtest v0.0.0-20221116180444-ea39cd8240db/go.mod h1:PWuyQ4fjFmo23Eo37wZD5K1Ot6Dx+zacsp3K04tSa2Y= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
#set -x | ||
|
||
# The script does automatic checking on a Go package and its sub-packages, | ||
# including: | ||
# 1. gofmt (https://golang.org/cmd/gofmt/) | ||
# 2. gosimple (https://github.com/dominikh/go-simple) | ||
# 3. unconvert (https://github.com/mdempsky/unconvert) | ||
# 4. ineffassign (https://github.com/gordonklaus/ineffassign) | ||
# 5. go vet (https://golang.org/cmd/vet) | ||
# 6. misspell (https://github.com/client9/misspell) | ||
# 7. unused (http://honnef.co/go/tools/unused) | ||
|
||
# golangci-lint (github.com/golangci/golangci-lint) is used to run each | ||
# static checker. | ||
|
||
go version | ||
|
||
# run tests on all modules | ||
ROOTPATH=$(go list -m) | ||
ROOTPATHPATTERN=$(echo $ROOTPATH | sed 's/\\/\\\\/g' | sed 's/\//\\\//g') | ||
MODPATHS=$(go list -m all | grep "^$ROOTPATHPATTERN" | sort | uniq | cut -d' ' -f1) | ||
for module in $MODPATHS; do | ||
# check linters | ||
MODNAME=$(echo $module | sed -E -e "s/^$ROOTPATHPATTERN//" \ | ||
-e 's,^/,,' -e 's,/v[0-9]+$,,') | ||
if [ -z "$MODNAME" ]; then | ||
MODNAME=. | ||
fi | ||
|
||
# run commands in the module directory as a subshell | ||
( | ||
cd $MODNAME | ||
|
||
go test ./... | ||
|
||
# run linters | ||
golangci-lint run --build-tags=rpctest --disable-all --deadline=10m \ | ||
--enable=gofmt \ | ||
--enable=gosimple \ | ||
--enable=unconvert \ | ||
--enable=ineffassign \ | ||
--enable=govet \ | ||
--enable=misspell \ | ||
--enable=unused \ | ||
) | ||
done | ||
|
||
echo "------------------------------------------" | ||
echo "Tests completed successfully!" |