Re: Test automation using perl or shell
On Sep 10, 2013, at 1:25 AM, Lalit Deshmukh wrote: > Hi, > > i have implemented 50 shell program to test. now i want to run all these > shell program one by one(in short test automation) (once first program > getting executed then next will start). please let me know how to do this? in > UNIX any utility or to run the same. The are several ways to run a shell program from Perl: 1. Use the system function. This will fork a process and run (exec) the shell program in that process. Standard output from the program will go to your standard output. The system call will return the exit status from the program as part of its return value. See 'perldoc -f system' for details. 2. Use the qx() operator or backticks (e.g., `program`). This will also result in a fork and exec, but the standard output from the program will be captured and returned to your program. See 'perldoc perlop' and search for "Quote-like Operators" or "qx/STRING/". 3. Use the open() function with a MODE of "|-" or "-|". In this case, you can either pipe input to the program with mode "|-" or receive output from the program with "-|". There are more complicated ways to do both. See 'perldoc -f open' for details. See also 'perldoc perlipc' for more suggestions on inter-process communication. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Test automation using perl or shell
On Tue, Sep 10, 2013 at 01:25:22AM -0700, Lalit Deshmukh wrote: > i have implemented 50 shell program to test. now i want to run all these > shell program one by one(in short test automation) (once first program > getting executed then next will start). please let me know how to do this? > in UNIX any utility or to run the same. If you have loops in your shell: (bash example, assumes the test programs are named t1.sh, t2.sh ... t50.sh) for TEST in t*sh do ./$TEST done in Perl, call with names of the test programs. #!/usr/bin/perl use strict; use warnings; foreach my $test (@ARGV) { system "./$test"; } -- Michael Rasmussen, Portland Oregon Be Appropriate && Follow Your Curiosity Other Adventures: http://www.jamhome.us/ or http://gplus.to/MichaelRpdx A special random fortune cookie fortune: It's the HoHo in HoHoHo! -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Test automation using perl or shell
Hello Lalit, This question sounds more nearer to Shell scripting than Perl. No offence, you can do this in Perl too, but since underlaying test scripts are shell based (which you mentioned as 'i have implemented 50 shell program to test' ), i would suggest you to write a wrapper shell script which calls rest of the 50 shell programs to execute and record the results. -- Best Regards, Shekar On Tue, Sep 10, 2013 at 1:55 PM, Lalit Deshmukh wrote: > Hi, > > i have implemented 50 shell program to test. now i want to run all these > shell program one by one(in short test automation) (once first program > getting executed then next will start). please let me know how to do this? > in UNIX any utility or to run the same. > > > any help will be really appreciated. > > thanks, > Lalit D >
Test automation using perl or shell
Hi, i have implemented 50 shell program to test. now i want to run all these shell program one by one(in short test automation) (once first program getting executed then next will start). please let me know how to do this? in UNIX any utility or to run the same. any help will be really appreciated. thanks, Lalit D
Re: Test Automation
Check CPAN for: Test::Unit Test::Simple Test::More and a few others. Dave On Mon, 26 Nov 2001, Ahmed Moustafa Ibrahim Ahmed wrote: > Hi Everybody, > > How can I automate the process of testing my Perl script? > Is there a standard way to do? > Is there a tool for testing Perl scripts? > > Your help will be appreciated so much. > > Ahmed > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Test Automation
Hi Everybody, How can I automate the process of testing my Perl script? Is there a standard way to do? Is there a tool for testing Perl scripts? Your help will be appreciated so much. Ahmed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]