mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
test_all: add tests
parameter to limit which tests to run for a backend
This commit is contained in:
parent
bc70bff125
commit
5eebbaaac4
|
@ -35,6 +35,21 @@ type Backend struct {
|
||||||
FastList bool // set to test with -fast-list
|
FastList bool // set to test with -fast-list
|
||||||
OneOnly bool // set to run only one backend test at once
|
OneOnly bool // set to run only one backend test at once
|
||||||
Ignore []string // test names to ignore the failure of
|
Ignore []string // test names to ignore the failure of
|
||||||
|
Tests []string // paths of tests to run, blank for all
|
||||||
|
}
|
||||||
|
|
||||||
|
// includeTest returns true if this backend should be included in this
|
||||||
|
// test
|
||||||
|
func (b *Backend) includeTest(t *Test) bool {
|
||||||
|
if len(b.Tests) == 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
for _, testPath := range b.Tests {
|
||||||
|
if testPath == t.Path {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeRuns creates Run objects the Backend and Test
|
// MakeRuns creates Run objects the Backend and Test
|
||||||
|
@ -42,6 +57,9 @@ type Backend struct {
|
||||||
// There can be several created, one for each combination of SubDir
|
// There can be several created, one for each combination of SubDir
|
||||||
// and FastList
|
// and FastList
|
||||||
func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
|
func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
|
||||||
|
if !b.includeTest(t) {
|
||||||
|
return runs
|
||||||
|
}
|
||||||
subdirs := []bool{false}
|
subdirs := []bool{false}
|
||||||
if b.SubDir && t.SubDir {
|
if b.SubDir && t.SubDir {
|
||||||
subdirs = append(subdirs, true)
|
subdirs = append(subdirs, true)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user