• Home
  • Raw
  • Download

Lines Matching defs:testContext

36 type testContext struct {  struct
37 t *testing.T
38 wd string
39 tempDir string
40 env []string
41 cfg *config
42 inputCmd *command
43 lastCmd *command
44 cmdCount int
45 cmdMock func(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
46 stdinBuffer bytes.Buffer
47 stdoutBuffer bytes.Buffer
48 stderrBuffer bytes.Buffer
50 umaskRestoreAction func()
58 func withTestContext(t *testing.T, work func(ctx *testContext)) {
81 func (ctx *testContext) umask(mask int) (oldmask int) {
88 func (ctx *testContext) initUmaskDependency(lockFn func(), unlockFn func()) {
99 func (ctx *testContext) maybeReleaseUmaskDependency() {
106 func (ctx *testContext) NoteTestReadsFromUmask() {
113 func (ctx *testContext) NoteTestWritesToUmask() {
117 func (ctx *testContext) getenv(key string) (string, bool) {
127 func (ctx *testContext) environ() []string {
131 func (ctx *testContext) getwd() string {
135 func (ctx *testContext) stdin() io.Reader {
139 func (ctx *testContext) stdout() io.Writer {
143 func (ctx *testContext) stdoutString() string {
147 func (ctx *testContext) stderr() io.Writer {
151 func (ctx *testContext) stderrString() string {
155 …c (ctx *testContext) run(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {
164 func (ctx *testContext) runWithTimeout(cmd *command, duration time.Duration) error {
168 func (ctx *testContext) exec(cmd *command) error {
177 func (ctx *testContext) must(exitCode int) *command {
185 func (ctx *testContext) mustFail(exitCode int) string {
192 func (ctx *testContext) updateConfig(cfg *config) {
199 func (ctx *testContext) newCommand(path string, args ...string) *command {
209 func (ctx *testContext) writeFile(fullFileName string, fileContent string) {
221 func (ctx *testContext) symlink(oldname string, newname string) {
236 func (ctx *testContext) readAllString(r io.Reader) string {