instruments pipe stdout to console - iphone

I'm looking to automate our iPhone unit tests by executing our unit test code directly on the device using the 'instruments' CLI (documentation linked below).
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/instruments.1.html
The application runs which is fine. However, I can't figure out a way to have it dump the stdout to a file or pipe the stdout to the console?

Related

Print Pre-action script in console

For testing purposes I am using a Pre-Action Script for my tests (that cleans a database for Webservices tests).
For now I am printing the output inside a file located in my test folder, following this SO post ( Xcode scheme pre-action script not running ).
# Pre Build Output
exec > ${PROJECT_DIR}/MyProjectTests/TestLogs.log 2>&1
echo "=== PRE-ACTION SCRIPT ==="
...
However this is not really handy to have to open a log file via command line whenever a test set is launched to see what happened.
Is there a way to redirect Pre-Action script's output directly inside XCode console?
Thanks a lot

NUnit console - when attempting to redirect output /err seems to have no effect

I've got an Nunit project with some tests and they all run as expected. Now I want to incorporate the running of these scripts automatically.
I'm trying to use some of the redirect options so I can separate the test output, but whatever combination I use, all I seem to get is the standard TestResult.xml. I can use /out:AnnotherOut.txt OK, but I'm really interested in capturing the error output using /err:TestErrors.txt.
Command line is:
(NunitConsole App) /nologo /framework:net-4.0 MyTestProject.nunit /include=Integration /err=TestErrors.txt

Printing to Console in scalding script

I am trying to display some content on the console in a scalding script. When I run the same logic in the scalding shell I get the desired output and when I run the script I get an error:
scripttest.scala:4: error: value dump is not a member of com.twitter.scalding.typed.TypedPipe[String]
The script is
import com.twitter.scalding._
class scripttest(args:Args) extends Job(args){
val hello = TypedPipe.from(TextLine("tutorial/data/hello.txt"))
hello.dump
}
When I ran the same logic in console, it ran successfully.
The output in console:
Hello world
Goodbye world
Please explain why this occurs and how to print to console in a scalding script.
After looking closely at the documentation, you will see in section "2.6 REPL Reference", subsection "2.6.1 Enrichments available on TypedPipe/Grouped/CoGrouped objects" :
.dump: Print the contents to stdout (uses .toIterator)
hence dump is available only in the REPL.
I don't see a "scalding way" to write on the console, nor do I think it would make sense: you are running a pipeline, so the only "guaranteed milestone" is the end of the pipeline, when you can just write your results into a file, as is done on all the tutorial scripts.
If it's just a matter of printing "hello my job started", remember it's just a Scala file and use println (for more advanced logging, Logback is your friend).
To run the script locally, after having cloned the repository:
> ./sbt assembly
> ./scripts/scald.rb --local MyScript.scala
The first line will run all tests and build "scald.rb", the script used in the second line to run your scalding script.

Output selenium test result as html after running perl script

I am currently looking for a way to output the test result nicely after running selenium perl script.
The htmlSuite command from running selenium server outputs a nice html format result page, but I don't know how to do that in perl script.
Problem is, I have it setup so that Selenium is being run 24/7 on a virtual machine workstation(Windows 7), where anyone one can run tests on. Therefore I can't use htmlSuite to run the test because the server will close after the test is finished.
Is there a command argument or perl script method to make selenium server output results on html or other nice format other than printing it on the command line?
Or is there a better way to do this?
If your script is output TAP (that's what Test::More would put out), then you can use the Test::Harness family of modules to parse that TAP and use it to generate an HTML report.
How nice is nice? Under Hudson/Jenkins this gives graphs and a tabular report of tests run:
prove --timer --formatter=TAP::Formatter::JUnit large_test.t >junit.xml

How can I communicate with an application that does not return to the command prompt?

I need to build a test bench by sending appropriate inputs to an application. However,
once I launch the application, it takes control and does not return to the command
prompt (unless an exit command is executed from the application). In that case
is there any technique by which I can send a command to that application from the Perl
script and interpret the output from that application?
My operating system is Windows.
If it's a GUI application, take a look at the Win32::GuiTest module. It sends events to GUI applications - simulating user input.
For a command line application, I would normally recommend the Expect module. Unfortunately, Expect doesn't work under Windows.
If there is anyway to write or redirect the application output to a file, you can always open that file to process/interpret the output. If you are talking about a command-line application, it should be easy to redirect the terminal output to a file using the '>' and '>>' characters. It may not be as easy with a GUI app, though.