NewInProcRunner returns a runner that executes CLI subcommands in the current process using cli.RunSubcommand().
(t *testing.T)
| 64 | |
| 65 | // NewInProcRunner returns a runner that executes CLI subcommands in the current process using cli.RunSubcommand(). |
| 66 | func NewInProcRunner(t *testing.T) *CLIInProcRunner { |
| 67 | t.Helper() |
| 68 | |
| 69 | if os.Getenv("KOPIA_EXE") != "" && os.Getenv("KOPIA_RUN_ALL_INTEGRATION_TESTS") == "" { |
| 70 | t.Skip("not running test since it's also included in the unit tests") |
| 71 | } |
| 72 | |
| 73 | return &CLIInProcRunner{ |
| 74 | CustomizeApp: func(a *cli.App, kp *kingpin.Application) { |
| 75 | a.AddStorageProvider(cli.StorageProvider{ |
| 76 | Name: "in-memory", |
| 77 | Description: "in-memory storage backend", |
| 78 | NewFlags: func() cli.StorageFlags { return &storageInMemoryFlags{} }, |
| 79 | }) |
| 80 | }, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | var _ CLIRunner = (*CLIInProcRunner)(nil) |