Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > doctest-alike for a unix shell?

Thread Tools

doctest-alike for a unix shell?

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

- Cheers, Paddy.

Reply With Quote
Posts: 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

Reply With Quote
Posts: 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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
compile C programs with UNIX system calls (= Unix Programs??) C Programming 18 01-10-2005 03:35 AM
compile C programs with UNIX system calls (= Unix Programs??) C++ 12 01-10-2005 03:35 AM
How can I call a script on UNIX with David ASP .Net 1 11-09-2004 05:00 AM
my own perl "dos->unix"/"unix->dos" Robert Wallace Perl Misc 7 01-22-2004 10:59 PM
Accessing .Net web application from UNIX Tony Baker ASP .Net 2 09-30-2003 06:16 PM