1
0
mirror of https://github.com/golang/go synced 2024-10-02 04:18:33 -06:00
go/ssa/interp/external_plan9.go
Alan Donovan cd908f1108 go.tools/ssa/interp: capture stdout/err of target programs and check for "BUG".
The $GOROOT/tests may print "BUG" on failure but do not
necessarily exit zero, so we must capture their output too.

Details:
- make plan9 use unix's valueToBytes function (now in externals.go)
- direct the target's syscall.Write and print/println built-ins to a new utility, write().  This may capture the output into a global variable.

R=gri, r
CC=golang-dev
https://golang.org/cl/14550044
2013-10-08 14:35:39 -04:00

45 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package interp
import (
"syscall"
"code.google.com/p/go.tools/ssa"
)
func ext۰syscall۰Close(fn *ssa.Function, args []value) value {
panic("syscall.Close not yet implemented")
}
func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
panic("syscall.Fstat not yet implemented")
}
func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
panic("syscall.Kill not yet implemented")
}
func ext۰syscall۰Lstat(fn *ssa.Function, args []value) value {
panic("syscall.Lstat not yet implemented")
}
func ext۰syscall۰Open(fn *ssa.Function, args []value) value {
panic("syscall.Open not yet implemented")
}
func ext۰syscall۰ParseDirent(fn *ssa.Function, args []value) value {
panic("syscall.ParseDirent not yet implemented")
}
func ext۰syscall۰Read(fn *ssa.Function, args []value) value {
panic("syscall.Read not yet implemented")
}
func ext۰syscall۰ReadDirent(fn *ssa.Function, args []value) value {
panic("syscall.ReadDirent not yet implemented")
}
func ext۰syscall۰Stat(fn *ssa.Function, args []value) value {
panic("syscall.Stat not yet implemented")
}
func ext۰syscall۰Write(fn *ssa.Function, args []value) value {
// func Write(fd int, p []byte) (n int, err error)
n, err := write(args[0].(int), valueToBytes(args[1]))
return tuple{n, wrapError(err)}
}