[smolder-commits] SF.net SVN: smolder: [673] trunk
Brought to you by:
michael_peters
From: <mic...@us...> - 2007-08-29 13:00:21
|
Revision: 673 http://smolder.svn.sourceforge.net/smolder/?rev=673&view=rev Author: michael_peters Date: 2007-08-29 06:00:15 -0700 (Wed, 29 Aug 2007) Log Message: ----------- updating to mention TAP::Harness and runtests Modified Paths: -------------- trunk/docs/running_your_tests.pod Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge - 6cb60ec2-19fc-4f48-ba02-516b4c84136d:/local/smolder:23500 ef85ff6a-427b-4ddd-bce6-61dc0fed61e7:/local/smolder/trunk:16062 + 6cb60ec2-19fc-4f48-ba02-516b4c84136d:/local/smolder:23500 ef85ff6a-427b-4ddd-bce6-61dc0fed61e7:/local/smolder/trunk:16199 Modified: trunk/docs/running_your_tests.pod =================================================================== --- trunk/docs/running_your_tests.pod 2007-08-29 12:54:39 UTC (rev 672) +++ trunk/docs/running_your_tests.pod 2007-08-29 13:00:15 UTC (rev 673) @@ -20,20 +20,31 @@ =head2 Running -=head3 smolder_prove +=head3 runtests The easiest way to run your tests for Smolder is to use -L<smolder_prove|bin/smolder_prove>. It works just like the normal -C<prove> that comes with L<Test::Harness> except that it will also -create a TAP Archive file of the test run. +the C<runtests> script that comes with the L<TAP::Harness> Perl module. +It has a C<--archive> option that tells it to generate an archive +of the TAP files. - $ smolder_prove --tap-archive + $ runtests --archive my_test_run.tar.gz +or + $ runtests --archive my_test_run.tar +or + $ runtests --archive my_test_run.zip +=head3 Full Diagnostic Messages + +Many times a failing test will output diagnostics messages giving more +information (ie, expected vs. received return values, etc). TAP output +is expected to be on STDOUT, but diagnostic information is usually on STDERR. +To capture all of this, simply use the C<--merge> flag for C<runtests>. + =head3 SmokeRunner::Multi Sometimes you have many different projects or different branches of the same project that you would like to test from an SVN source checkout. -L<SmokeRunner::Multi> was designed for just this purpose. +The Perl module L<SmokeRunner::Multi> was designed for just this purpose. It can be used simply to run tests and output them to your screen, or create TAP archive and even automatically upload it to a running Smolder @@ -43,11 +54,11 @@ The easiest way to automate the uploading of test results to a running Smolder is to use L<smolder_smoke_signal|bin/smolder_smoke_signal>. It -takes an XML or YAML file and uploads it to the Smolder server of your +takes a TAP archive file and uploads it to the Smolder server of your choice. smolder_smoke_signal --server smolder.foo.com \ - --username myself --password s3cr3t --file test_report.xml \ + --username myself --password s3cr3t --file test_report.tar.gz \ --project MyProject =head2 Altogether Now @@ -56,52 +67,10 @@ as this: !#/bin/bash - smolder_prove --tap-archive + runtests --archive test_run.tar.gz smolder_smoke_signal --server smolder.foo.com \ --username myself --password s3cr3t --file test_run.tar.gz \ --project MyProject Pretty easy. -=head2 Full Diagnostic Messages - -Many times a failing test will output diagnostics messages giving more -information (ie, expected vs. received return values, etc). In Perl tests there -is a slight problem with capturing this output. Smolder would -be able to capture this reliably if it weren't for a legacy design decision -in L<Test::Builder>, which is used by almost every testing class in Perl. - -To get around this, you need to inform L<Test::Builder> that diagnostic -output should go to the same output stream as normal TAP output. The following -code accomplishes this: - - use Test::Builder; - sub import { - no warnings; - *Test::Builder::failure_output = sub { return \*STDOUT }; - } - -Now, it would be pretty annoying and repetitive to put this at the top of -every test file in your project. A better way would be to create a package -for your project that contains this, and then use that package in all your test -scripts. - -Something like this: - - package MyProject::TestScript; - use Test::Builder; - sub import { - no warnings; - *Test::Builder::failure_output = sub { return \*STDOUT }; - } - 1; - -And then in your testfile F<t/foo.t> you would have something like this: - - use script; - use warnings; - use Test::More; - use MyProject::TestScript; - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |