allow usage of -short in the testing framework

This commit is contained in:
yparitcher 2019-08-29 01:10:10 -04:00 committed by Nick Craig-Wood
parent 693112d57e
commit 52df19ad34
3 changed files with 8 additions and 0 deletions

View file

@ -18,6 +18,7 @@ import (
type Test struct { type Test struct {
Path string // path to the source directory Path string // path to the source directory
FastList bool // if it is possible to add -fast-list to tests FastList bool // if it is possible to add -fast-list to tests
Short bool // if it is possible to run the test with -short
AddBackend bool // set if Path needs the current backend appending AddBackend bool // set if Path needs the current backend appending
NoRetries bool // set if no retries should be performed NoRetries bool // set if no retries should be performed
NoBinary bool // set to not build a binary in advance NoBinary bool // set to not build a binary in advance
@ -31,6 +32,7 @@ type Backend struct {
Backend string // name of the backend directory Backend string // name of the backend directory
Remote string // name of the test remote Remote string // name of the test remote
FastList bool // set to test with -fast-list FastList bool // set to test with -fast-list
Short bool // set to test with -short
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 Tests []string // paths of tests to run, blank for all
@ -75,6 +77,7 @@ func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
Backend: b.Backend, Backend: b.Backend,
Path: t.Path, Path: t.Path,
FastList: fastlist, FastList: fastlist,
Short: (b.Short && t.Short),
NoRetries: t.NoRetries, NoRetries: t.NoRetries,
OneOnly: b.OneOnly, OneOnly: b.OneOnly,
NoBinary: t.NoBinary, NoBinary: t.NoBinary,

View file

@ -2,6 +2,7 @@ tests:
- path: backend - path: backend
addbackend: true addbackend: true
nobinary: true nobinary: true
short: true
- path: fs/operations - path: fs/operations
fastlist: true fastlist: true
- path: fs/sync - path: fs/sync

View file

@ -39,6 +39,7 @@ type Run struct {
Backend string // name of the backend Backend string // name of the backend
Path string // path to the source directory Path string // path to the source directory
FastList bool // add -fast-list to tests FastList bool // add -fast-list to tests
Short bool // add -short
NoRetries bool // don't retry if set NoRetries bool // don't retry if set
OneOnly bool // only run test for this backend at once OneOnly bool // only run test for this backend at once
NoBinary bool // set to not build a binary NoBinary bool // set to not build a binary
@ -335,6 +336,9 @@ func (r *Run) Init() {
if r.FastList { if r.FastList {
r.cmdLine = append(r.cmdLine, "-fast-list") r.cmdLine = append(r.cmdLine, "-fast-list")
} }
if r.Short {
r.cmdLine = append(r.cmdLine, "-short")
}
r.cmdString = toShell(r.cmdLine) r.cmdString = toShell(r.cmdLine)
} }