Commit 02b38384 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: use testutil.VerboseTest

parent 9733055c
......@@ -9,6 +9,7 @@ import (
"testing"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/internal/testutil"
)
type nodeReadNode struct {
......@@ -66,7 +67,7 @@ func TestNoOpen(t *testing.T) {
root := newNodeReadNode(true, true, nil)
root.noOpen = true
s, _, err := MountRoot(dir, root, &Options{Debug: VerboseTest()})
s, _, err := MountRoot(dir, root, &Options{Debug: testutil.VerboseTest()})
if err != nil {
t.Fatalf("MountRoot: %v", err)
}
......@@ -108,7 +109,7 @@ func TestNodeRead(t *testing.T) {
root := newNodeReadNode(false, true, nil)
opts := NewOptions()
opts.Debug = VerboseTest()
opts.Debug = testutil.VerboseTest()
s, _, err := MountRoot(dir, root, opts)
if err != nil {
t.Fatalf("MountRoot: %v", err)
......
......@@ -11,6 +11,7 @@ import (
"time"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/internal/testutil"
)
const testTtl = 100 * time.Millisecond
......@@ -31,9 +32,9 @@ func setupMemNodeTest(t *testing.T) (wd string, root Node, clean func()) {
EntryTimeout: testTtl,
AttrTimeout: testTtl,
NegativeTimeout: 0.0,
Debug: VerboseTest(),
Debug: testutil.VerboseTest(),
})
state, err := fuse.NewServer(connector.RawFS(), mnt, &fuse.MountOptions{Debug: VerboseTest()})
state, err := fuse.NewServer(connector.RawFS(), mnt, &fuse.MountOptions{Debug: testutil.VerboseTest()})
if err != nil {
t.Fatal("NewServer", err)
}
......
// Copyright 2016 the Go-FUSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package nodefs
import "flag"
// VerboseTest returns true if the testing framework is run with -v.
func VerboseTest() bool {
flag := flag.Lookup("test.v")
return flag != nil && flag.Value.String() == "true"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment