1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

fstest: let backends advertise maximum file size

This commit is contained in:
Ivan Andreev
2019-09-16 20:52:41 +03:00
committed by Nick Craig-Wood
parent 1e4691f951
commit 661dc568f3
6 changed files with 34 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ import (
"regexp"
"runtime"
"sort"
"strconv"
"strings"
"sync"
"time"
@@ -43,6 +44,7 @@ type Run struct {
NoRetries bool // don't retry if set
OneOnly bool // only run test for this backend at once
NoBinary bool // set to not build a binary
SizeLimit int64 // maximum test file size
Ignore map[string]struct{}
// Internals
cmdLine []string
@@ -339,6 +341,9 @@ func (r *Run) Init() {
if r.Short {
r.cmdLine = append(r.cmdLine, "-short")
}
if r.SizeLimit > 0 {
r.cmdLine = append(r.cmdLine, "-size-limit", strconv.FormatInt(r.SizeLimit, 10))
}
r.cmdString = toShell(r.cmdLine)
}