"mv": (*testScript).cmdMv,
"rm": (*testScript).cmdRm,
"skip": (*testScript).cmdSkip,
+ "sleep": (*testScript).cmdSleep,
"stale": (*testScript).cmdStale,
"stderr": (*testScript).cmdStderr,
"stdout": (*testScript).cmdStdout,
ts.t.Skip()
}
+// sleep sleeps for the given duration
+func (ts *testScript) cmdSleep(want simpleStatus, args []string) {
+ if len(args) != 1 {
+ ts.fatalf("usage: sleep duration")
+ }
+ d, err := time.ParseDuration(args[0])
+ if err != nil {
+ ts.fatalf("sleep: %v", err)
+ }
+ if want != success {
+ ts.fatalf("unsupported: %v sleep", want)
+ }
+ time.Sleep(d)
+}
+
// stale checks that the named build targets are stale.
func (ts *testScript) cmdStale(want simpleStatus, args []string) {
if len(args) == 0 {
- skip [message]
Mark the test skipped, including the message if given.
+- sleep duration
+ Sleep for the given duration (a time.Duration string).
+ (Tests should generally poll instead of sleeping, but sleeping may sometimes
+ be necessary, for example, to ensure that modified files have unique mtimes.)
+
- [!] stale path...
The packages named by the path arguments must (or must not)
be reported as "stale" by the go command.