Fix eval tests.

This commit is contained in:
Qi Xiao 2016-02-11 19:11:38 +01:00
parent 72f92911e2
commit 9a77f61287
2 changed files with 13 additions and 3 deletions

View File

@ -33,6 +33,10 @@ var (
ErrStillRunning = errors.New("still running")
)
// Whether elvish should attempt to put itself in foreground after each pipeline
// execution.
var PutInForeground = true
type scope map[string]bool
type (
@ -160,9 +164,11 @@ func (cp *compiler) pipeline(n *parse.Pipeline) Op {
signal.Stop(intCh)
// Make sure I am in foreground.
err := sys.Tcsetpgrp(0, syscall.Getpgrp())
if err != nil {
throw(err)
if PutInForeground {
err := sys.Tcsetpgrp(0, syscall.Getpgrp())
if err != nil {
throw(err)
}
}
if !allok(errors) {

View File

@ -222,6 +222,10 @@ func evalAndCollect(t *testing.T, texts []string, chsize int) ([]Value, []byte,
return outs, outBytes, ex
}
func init() {
PutInForeground = false
}
func TestEval(t *testing.T) {
for _, tt := range evalTests {
// fmt.Printf("eval %q\n", tt.text)