Issue #17 open
--debug for printing commands as they execute
It'd be nice to be able to run cram --debug test.t and see the test's input/output as it runs.
I took a stab at this last night, but ran into a number of problems:
- We'd have to change how we buffer input/output to the subprocess. I'm not sure what practical effect this would have. Right now we let the OS decide the buffering (bufsize=-1).
- We wouldn't be able to use p.communicate() to send stdin and read stdout. The Python docs seem to imply using communicate() is the only reliable way to communicate with a subprocess without potentially getting tripped up by buffer limits.
- To interactively print the test, as it executes, in the test format (not the intermediate script that we generate), we have to read from stdout process the output at the same time. It seems easy to print a command group after it's run (when we see a salt, we can process what's in our postout buffer). However, I'm not sure how to show the command currently being executed. I think we'd have to generate a "post" salt and inject that into the script output as well.