Perl as a testengine, problems analyzing results

T

time_error

Hi

I have previously used perl as a framework for testing an embedded
device via. telnet. It was quite easy, just send input data (commands,
mails, network traffic) and analyze logfiles and telnet output for
expected output – obvious it was a little more complex than that, but
I think you get the idea.

My new project is a pure windows console application. So what I want
is to stimulate my application with input (mails, SMS´s, UDP data,
direct application input (it has a built-in command shell)) and
analyze the console output and logfiles.

My test starts with an empty prompt - I write something like this: >
perl framework.pl test_file1.pl and hit <enter>. The framework then
does a lot of stuff and finally launches the application.

1)
The application writes output to the console, but I cannot figure out
how to read the output.

2)
I would like to read a log file generated by the application. If I try
something like this: system(“type logfile.log”) nothing happens.
Perhaps I can use some Perl specific fileroutines to read filecontent?


I suspect that the Perlscript is blocked until the application exists.
So my real question is in fact: Can I start and stop the application
in another prompt (context) and how is this accomplished using Perl?
Then I just analyze logfiles for test results (and abandon reading
console output).
 
M

Marc Lucksch

1)
The application writes output to the console, but I cannot figure out
how to read the output.
Maybe this can help, (from perlfaq8):
http://perldoc.perl.org/perlfaq8.html#How-can-I-capture-STDERR-from-an-external-command?
2)
I would like to read a log file generated by the application. If I try
something like this: system(“type logfile.log”) nothing happens.
Perhaps I can use some Perl specific fileroutines to read filecontent?
Maybe this can help, (from perlfaq8):
http://perldoc.perl.org/perlfaq8.html#Why-can't-I-get-the-output-of-a-command-with-system()?

Marc "Maluku" Lucksch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top