mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
vfstests: move functional tests from mountlib and make them work with VFS
The tests are now run for the mount commands and for the plain VFS. This makes the tests much easier to debug when running with a VFS than through a mount.
This commit is contained in:
30
vfs/vfstest_test.go
Normal file
30
vfs/vfstest_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Run the more functional vfstest package on the vfs
|
||||
|
||||
package vfs_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
_ "github.com/rclone/rclone/backend/all" // import all the backends
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fstest"
|
||||
"github.com/rclone/rclone/vfs"
|
||||
"github.com/rclone/rclone/vfs/vfstest"
|
||||
)
|
||||
|
||||
// TestExt runs more functional tests all the tests against all the
|
||||
// VFS cache modes
|
||||
func TestFunctional(t *testing.T) {
|
||||
if *fstest.RemoteName != "" {
|
||||
t.Skip("Skip on non local")
|
||||
}
|
||||
vfstest.RunTests(t, true, func(f fs.Fs, mountpoint string) (VFS *vfs.VFS, unmountResult <-chan error, unmount func() error, err error) {
|
||||
unmountResultChan := make(chan (error), 1)
|
||||
unmount = func() error {
|
||||
unmountResultChan <- nil
|
||||
return nil
|
||||
}
|
||||
VFS = vfs.New(f, nil)
|
||||
return VFS, unmountResultChan, unmount, nil
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user