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 lastCmd *command
43 cmdCount int
44 cmdMock func(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
45 stdinBuffer bytes.Buffer
46 stdoutBuffer bytes.Buffer
47 stderrBuffer bytes.Buffer
49 umaskRestoreAction func()
57 func withTestContext(t *testing.T, work func(ctx *testContext)) {
80 func (ctx *testContext) umask(mask int) (oldmask int) {
87 func (ctx *testContext) setArbitraryClangArtifactsDir() string {
93 func (ctx *testContext) initUmaskDependency(lockFn func(), unlockFn func()) {
104 func (ctx *testContext) maybeReleaseUmaskDependency() {
111 func (ctx *testContext) NoteTestReadsFromUmask() {
118 func (ctx *testContext) NoteTestWritesToUmask() {
122 func (ctx *testContext) getenv(key string) (string, bool) {
132 func (ctx *testContext) environ() []string {
136 func (ctx *testContext) getwd() string {
140 func (ctx *testContext) stdin() io.Reader {
144 func (ctx *testContext) stdout() io.Writer {
148 func (ctx *testContext) stdoutString() string {
152 func (ctx *testContext) stderr() io.Writer {
156 func (ctx *testContext) stderrString() string {
160 …c (ctx *testContext) run(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {
169 func (ctx *testContext) runWithTimeout(cmd *command, duration time.Duration) error {
173 func (ctx *testContext) exec(cmd *command) error {
182 func (ctx *testContext) must(exitCode int) *command {
190 func (ctx *testContext) mustFail(exitCode int) string {
197 func (ctx *testContext) updateConfig(cfg *config) {
201 func (ctx *testContext) newCommand(path string, args ...string) *command {
211 func (ctx *testContext) writeFile(fullFileName string, fileContent string) {
223 func (ctx *testContext) symlink(oldname string, newname string) {
238 func (ctx *testContext) readAllString(r io.Reader) string {