mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-22 00:15:39 +00:00
commit
4760b77e54
7 changed files with 21 additions and 1 deletions
11
Makefile
11
Makefile
|
@ -16,6 +16,14 @@ validation: .test .lint .vet .cli.test
|
||||||
.PHONY: validation.tags
|
.PHONY: validation.tags
|
||||||
validation.tags: .test.tags .vet.tags .cli.test
|
validation.tags: .test.tags .vet.tags .cli.test
|
||||||
|
|
||||||
|
.PHONY: gocyclo
|
||||||
|
gocyclo: .gocyclo
|
||||||
|
|
||||||
|
CLEAN_FILES += .gocyclo
|
||||||
|
|
||||||
|
.gocyclo:
|
||||||
|
gocyclo -avg -over 15 -ignore 'vendor/*' . && touch $@
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: .test
|
test: .test
|
||||||
|
|
||||||
|
@ -69,7 +77,8 @@ $(BUILD): $(SOURCE_FILES)
|
||||||
go build -mod=vendor -o $(BUILD) $(BUILDPATH)
|
go build -mod=vendor -o $(BUILD) $(BUILDPATH)
|
||||||
|
|
||||||
install.tools:
|
install.tools:
|
||||||
@go get -u github.com/fatih/color ; \
|
@go install -u github.com/fatih/color@latest ; \
|
||||||
|
go install -u github.com/fzipp/gocyclo/cmd/gocyclo@latest ; \
|
||||||
if [ "$(findstring $(GO_VER),$(shell go version))" != "" ] ; then \
|
if [ "$(findstring $(GO_VER),$(shell go version))" != "" ] ; then \
|
||||||
go get -u golang.org/x/lint/golint ;\
|
go get -u golang.org/x/lint/golint ;\
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -35,6 +35,7 @@ func TestCompare(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestCompareModified(t *testing.T) {
|
func TestCompareModified(t *testing.T) {
|
||||||
dir, err := ioutil.TempDir("", "test-compare-modified")
|
dir, err := ioutil.TempDir("", "test-compare-modified")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -114,6 +115,7 @@ func TestCompareModified(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestCompareMissing(t *testing.T) {
|
func TestCompareMissing(t *testing.T) {
|
||||||
dir, err := ioutil.TempDir("", "test-compare-missing")
|
dir, err := ioutil.TempDir("", "test-compare-missing")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -205,6 +207,7 @@ func TestCompareMissing(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestCompareExtra(t *testing.T) {
|
func TestCompareExtra(t *testing.T) {
|
||||||
dir, err := ioutil.TempDir("", "test-compare-extra")
|
dir, err := ioutil.TempDir("", "test-compare-extra")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -338,6 +341,7 @@ func TestCompareKeys(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestTarCompare(t *testing.T) {
|
func TestTarCompare(t *testing.T) {
|
||||||
dir, err := ioutil.TempDir("", "test-compare-tar")
|
dir, err := ioutil.TempDir("", "test-compare-tar")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -71,6 +71,7 @@ func (fs *MockFsEval) KeywordFunc(fn KeywordFunc) KeywordFunc {
|
||||||
return fn
|
return fn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestCheckFsEval(t *testing.T) {
|
func TestCheckFsEval(t *testing.T) {
|
||||||
dir, err := ioutil.TempDir("", "test-check-fs-eval")
|
dir, err := ioutil.TempDir("", "test-check-fs-eval")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/vbatts/go-mtree/xattr"
|
"github.com/vbatts/go-mtree/xattr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestXattr(t *testing.T) {
|
func TestXattr(t *testing.T) {
|
||||||
testDir, present := os.LookupEnv("MTREE_TESTDIR")
|
testDir, present := os.LookupEnv("MTREE_TESTDIR")
|
||||||
if present == false {
|
if present == false {
|
||||||
|
|
|
@ -129,6 +129,7 @@ func TestTar(t *testing.T) {
|
||||||
// `tar -cvf some.tar dir1 dir2 dir3 dir4/dir5 dir6` ... etc.
|
// `tar -cvf some.tar dir1 dir2 dir3 dir4/dir5 dir6` ... etc.
|
||||||
// The testdata of collection.tar resemble such an archive. the `collection` folder
|
// The testdata of collection.tar resemble such an archive. the `collection` folder
|
||||||
// is the contents of `collection.tar` extracted
|
// is the contents of `collection.tar` extracted
|
||||||
|
//gocyclo:ignore
|
||||||
func TestArchiveCreation(t *testing.T) {
|
func TestArchiveCreation(t *testing.T) {
|
||||||
fh, err := os.Open("./testdata/collection.tar")
|
fh, err := os.Open("./testdata/collection.tar")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -197,6 +198,7 @@ func TestArchiveCreation(t *testing.T) {
|
||||||
// evaluated. Also, The fact that this archive contains a single entry, yet the
|
// evaluated. Also, The fact that this archive contains a single entry, yet the
|
||||||
// entry is associated with a file that has parent directories, means that the
|
// entry is associated with a file that has parent directories, means that the
|
||||||
// "." directory should be the lowest sub-directory under which `file` is contained.
|
// "." directory should be the lowest sub-directory under which `file` is contained.
|
||||||
|
//gocyclo:ignore
|
||||||
func TestTreeTraversal(t *testing.T) {
|
func TestTreeTraversal(t *testing.T) {
|
||||||
fh, err := os.Open("./testdata/traversal.tar")
|
fh, err := os.Open("./testdata/traversal.tar")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -15,6 +15,7 @@ func init() {
|
||||||
//logrus.SetLevel(logrus.DebugLevel)
|
//logrus.SetLevel(logrus.DebugLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestXattrUpdate(t *testing.T) {
|
func TestXattrUpdate(t *testing.T) {
|
||||||
content := []byte("I know half of you half as well as I ought to")
|
content := []byte("I know half of you half as well as I ought to")
|
||||||
// a bit dirty to create/destroy a directory in cwd, but often /tmp is
|
// a bit dirty to create/destroy a directory in cwd, but often /tmp is
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build go1.7
|
||||||
// +build go1.7
|
// +build go1.7
|
||||||
|
|
||||||
package mtree
|
package mtree
|
||||||
|
@ -20,6 +21,7 @@ func init() {
|
||||||
logrus.SetLevel(logrus.DebugLevel)
|
logrus.SetLevel(logrus.DebugLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gocyclo:ignore
|
||||||
func TestUpdate(t *testing.T) {
|
func TestUpdate(t *testing.T) {
|
||||||
content := []byte("I know half of you half as well as I ought to")
|
content := []byte("I know half of you half as well as I ought to")
|
||||||
dir, err := ioutil.TempDir("", "test-check-keywords")
|
dir, err := ioutil.TempDir("", "test-check-keywords")
|
||||||
|
|
Loading…
Reference in a new issue