chapel-lang/chapel — pull request #956 by thomasvandoren (2014-12-03 01:17:28+00:00)
Title: Fix stdin support when multiple lines in .execopts.

Previously, a .execopts file like the one below would successfully run with
green.txt, but would fail when running the second configuration for red.txt:

```
< green.txt # cond.if.green.good
< red.txt # cond.if.red.good
< yellow.txt # cond.if.yellow.good
```

Error message:

```
...
[Executing program ./cond.if < green.txt]
[Executing diff cond.if.green.good cond.if.0-1.exec.out.tmp]
[Success matching program output for /Users/tvandoren/src/pytochpl/docs/source/examples/cond.if]
[Error: a redirection file already exists: green.txt]
```

The error is coming from the second iteration of the .execopts loop because the
stdin file is not reset with each loop.

Update sub_test to track when stdin file is modified by .execopts and reset at
the beginning of each .execopts iteration.