By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

doctest-alike for a unix shell?

P: n/a
Anyone know of something that can turn an interactive bash or tcsh
session into a test the
way doctest does?

- Cheers, Paddy.

Mar 13 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
1. Try os.popen:
import os
os.popen('echo Hello World').read()

'Hello World\n'

2. Try a test environment built for testing shell commands, such as

Mar 13 '06 #2

P: n/a
Thanks for the pointer to dejagnu, although it is not what I was after.

The question came about because I was scripting an interface to an
electronics design automation tool that comes with a TCL interface.
I was using a companion perl script called from the TCL to do most of
the more complex checking (I am still not allowed Python at work, sob).

I found myself testing the perl script by calling it repeatedly from
tcsh , with different options and different files and directories
created in its run directory that I knew it was sensitive to. I
scrolled back in my xterm window and thought that there before me was
most of my tests! If only their was doctest for tcsh, I could tell the
tool what my prompt strings were, cut-n-paste my shell session, and
Bobs yer uncle!

I guess doctest-alikes could be created for a lot of shell type
interfaces with distinct prompts.

- Paddy.

Mar 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.