How to integrate other scripts with Test::Harness?

Y

yusuf

Hi,

I was trying to use Test::Harness to gather output from my bash scripts
as well, and I'm having problems with items being printed by the
script.

How do I get all stdout and stderr from the script to be just printed
by the Test::Harness, rather than disappearing?

Thanks.
 
P

Paul Lalli

yusuf said:
I was trying to use Test::Harness to gather output from my bash scripts
as well, and I'm having problems with items being printed by the
script.

How do I get all stdout and stderr from the script to be just printed
by the Test::Harness, rather than disappearing?

In the past, you've been asked by several people - myself included - to
post a SHORT but COMPLETE script when you have difficulties. Why do
you continue to refuse to do that? Why do you continue to expect free
help without following even the most simple of requests?

Additionally, please read the documentation for the module you are
using. In this case, perldoc Test::Harness shows:
==============================
STOP! If all you want to do is write a test script, consider using
Test::Simple. Test::Harness is the module that reads the output from
Test::Simple, Test::More and other modules based on Test::Builder. You
don't need to know about Test::Harness to use those modules.

Test::Harness runs tests and expects output from the test in a certain
format. That format is called TAP, the Test Anything Protocol. It is
defined in Test::Harness::TAP.
==============================

So, are you sure you know what you're doing? Doesn't really sound like
your tests *should* be outputting anything other than TAP formatted
messages.

If you were to keep reading, you would find:
==============================
$Test::Harness::Verbose
The package variable $Test::Harness::Verbose is exportable and can be
used to let runtests() display the standard output of the script
without altering the behavior otherwise. The prove utility's -v flag
will set this.
===============================

Did you try that?

Paul Lalli
 
Y

yusuf

Paul said:
In the past, you've been asked by several people - myself included - to
post a SHORT but COMPLETE script when you have difficulties. Why do
you continue to refuse to do that? Why do you continue to expect free
help without following even the most simple of requests?

Additionally, please read the documentation for the module you are
using. In this case, perldoc Test::Harness shows:
==============================
STOP! If all you want to do is write a test script, consider using
Test::Simple. Test::Harness is the module that reads the output from
Test::Simple, Test::More and other modules based on Test::Builder. You
don't need to know about Test::Harness to use those modules.

Test::Harness runs tests and expects output from the test in a certain
format. That format is called TAP, the Test Anything Protocol. It is
defined in Test::Harness::TAP.
==============================

So, are you sure you know what you're doing? Doesn't really sound like
your tests *should* be outputting anything other than TAP formatted
messages.

If you were to keep reading, you would find:
==============================
$Test::Harness::Verbose
The package variable $Test::Harness::Verbose is exportable and can be
used to let runtests() display the standard output of the script
without altering the behavior otherwise. The prove utility's -v flag
will set this.
===============================

Thanks for you help. I didn't post code, because this didn't seem to be
a code issue. I'll do that next time.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top