🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3819

Re: Writing a script

#3819
From: Peter Roozemaal
Date: Wed, 06 Dec 2000 00:00
37 lines
2272 bytes
Jody Zung wrote:
> 
> So basically it'll look like this.
> 
> I have a process called OMC that I run on a file. There are options as
> well, so a command from the unix prompt would look like this:
> 
> omc  -dtmlckf -o <output dir> <filename.lib>
> 
> Then the thing runs for a while and ouputs a huge amount of stuff.
> After this I want to check the output directory for the correct files.
> 
> So i'll cd to the output directory, do an ls, or ll and visually check
> for the needed files.
> 
> Is there a way i can do all of this in a script and output to a results
> file??
> 
Yes, it's easy, but details depend on details of the application. It
looks like you're testing some batch application.

First: define testcases. (A testcase consists of an initialisation step,
followed by a sequence of program runs and validation of program
behavior: init, run, test, run, test,...)

Write a generic testcase driver that will perform
 1. the initialisation of the environment (depending on the testcase)
 in a loop
   2. run the application with the test inputfile
   3. check the correctness of the test output

You can use "i/o redirection" to collect output from your programs and
script in a file. For regressiontests it is convenient to have a set of
files with correct output so you can just run cmp or diff to check
whether anything has changed.

Peter.
Technical Details
Message-ID: <3A2E790B.2E7997E0@xs4all.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3A2E6922.61778861@siliconmetrics.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc89c,447395ef176ca092
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 1025b4,447395ef176ca092
X-Google-Attributes: gid1025b4,public
X-Google-Thread: 11035d,447395ef176ca092
X-Google-Attributes: gid11035d,public
From: Peter Roozemaal <mathfox@xs4all.nl>
Subject: Re: Writing a script
Date: 2000/12/06
Message-ID: <3A2E790B.2E7997E0@xs4all.nl>
X-Deja-AN: 701831263
Content-Transfer-Encoding: 7bit
References: <3A2E6922.61778861@siliconmetrics.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@xs4all.nl
X-Trace: news1.xs4all.nl 976124167 7219 213.84.14.16 (6 Dec 2000 17:36:07 GMT)
Organization: Mathfox Automatisering
Mime-Version: 1.0
NNTP-Posting-Date: 6 Dec 2000 17:36:07 GMT
Newsgroups: comp.unix.programmer,comp.unix.solaris,gnu.misc.discuss