(t *testing.T, tsEnv testScriptEnv, command string)
| 257 | } |
| 258 | |
| 259 | func testScriptParamsFor(t *testing.T, tsEnv testScriptEnv, command string) testscript.Params { |
| 260 | t.Helper() |
| 261 | files, filtered := selectScripts(command, tsEnv.scripts) |
| 262 | |
| 263 | var dir string |
| 264 | if !filtered { |
| 265 | // No filter was set - run everything in the directory. |
| 266 | dir = path.Join("testdata", command) |
| 267 | } else if len(files) == 0 { |
| 268 | // A filter was set but none of the selected scripts belong to this |
| 269 | // command directory, so skip rather than running the whole directory. |
| 270 | t.Skipf("testdata/%s: no selected script belongs to this command directory", command) |
| 271 | } |
| 272 | |
| 273 | return testscript.Params{ |
| 274 | Dir: dir, |
| 275 | Files: files, |
| 276 | Setup: sharedSetup(tsEnv), |
| 277 | Cmds: sharedCmds(tsEnv), |
| 278 | RequireExplicitExec: true, |
| 279 | RequireUniqueNames: true, |
| 280 | TestWork: tsEnv.preserveWorkDir, |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | var keyT struct{} |
| 285 |
no test coverage detected