[svn:parrot] r44637 - in trunk: docs t/op
dukeleto at svn.parrot.org
dukeleto at svn.parrot.org
Fri Mar 5 05:16:12 UTC 2010
Author: dukeleto
Date: Fri Mar 5 05:16:10 2010
New Revision: 44637
URL: https://trac.parrot.org/parrot/changeset/44637
Log:
[docs] Update tests.pod a bit and remove a wrong comment from t/op/sprintf.t
Modified:
trunk/docs/tests.pod
trunk/t/op/sprintf.t
Modified: trunk/docs/tests.pod
==============================================================================
--- trunk/docs/tests.pod Fri Mar 5 02:43:01 2010 (r44636)
+++ trunk/docs/tests.pod Fri Mar 5 05:16:10 2010 (r44637)
@@ -7,16 +7,16 @@
=head1 A basic guide to writing and running tests for Parrot
-This is quick and dirty pointer to how the Parrot test suite is executed and
-to how new tests for Parrot should be written.
-The testing system is liable to change in the future, but tests written
-following the guidelines below should be easy to port into a new test suite.
+This is quick and dirty primer on to how the Parrot test suite is executed and
+to how new tests for Parrot should be written. The testing system is liable to
+change in the future, but tests written following the guidelines below should be
+easy to port into a new test suite.
=head1 How to test parrot
-The easy way to test parrot is running C<make test>. If you have
-updated your code recently and tests began failing, go for a C<make
-realclean> and recompile parrot before complaining.
+The easy way to test parrot is running C<make test>. If you have updated your
+code recently and tests began failing, go for a C<make realclean> and recompile
+parrot before complaining.
C<make languages-test> runs the test suite for most language implementations
in the languages directory.
@@ -26,41 +26,47 @@
Parrot has a status page with smoke test results at
L<http://smolder.plusthree.com/app/public_projects/details/8>.
-You can supply new tests results by just running C<make smoke>.
-It will run the same tests as C<make test> would, but will upload
-the test results to the website.
+You can supply new tests results by just running C<make smoke>. It will run the
+same tests as C<make test> would, but will upload the test results to the
+website.
=head1 Location of the test files
The parrot test files, the F<*.t> files, can be found in the F<t> directory.
-A quick overview over the subdirs in F<t> can be found in F<t/README>.
+A quick overview over the subdirs in F<t> can be found in F<t/README>.
The language implementations usually have their test files in F<languages/*/t>.
-New tests should be added to an existing F<*.t> file.
-If a previously untested feature is tested,
-it might also make sense to create a new F<*.t> file.
+New tests should be added to an existing F<*.t> file. If a previously untested
+feature is tested, it might also make sense to create a new F<*.t> file. You
+may also see tests named like foo-old.t, which are Perl tests that are in the
+process of being translated to PIR.
=head1 How to write a test
Test scripts must emit text that conforms to the C<Test Anything Protocol>.
-Test scripts are currently usually written in Perl 5 or PIR.
-The Perl 5 module C<Parrot::Test>
-and the PIR module C<Test;More> help with writing tests.
+Test scripts are currently usually written in PIR or Perl 5. The Perl 5 module
+C<Parrot::Test> and the PIR module C<Test;More> help with writing tests.
+Writing tests in PIR is preferred, but there are some cases where the
+proper framework is not available. If you can, write your tests in PIR.
The testing framework needs to know how many tests it should expect. So the
number of planned tests needs to be incremented when adding a new test. This
is done near the top of a test file, in a line that looks like:
+ plan(42)
+
+in PIR tests and
+
use Parrot::Test tests => 8;
-for Perl 5 based test scripts.
+for Perl 5 test scripts.
=head2 Testing Parrot Assembler
PASM tests are mostly used for testing ops. Appropriate test files for basic
-ops are F<t/op/*.t>. Polymorphic Containers are tested in F<t/pmc/*.t>. Add the
-new test like this:
+ops are F<t/op/*.t>. Polymorphic Containers are tested in F<t/pmc/*.t>. Add
+the new test like this:
pasm_output_is(<<'CODE', <<'OUTPUT', "name for test");
*** a big chunk of assembler, eg:
Modified: trunk/t/op/sprintf.t
==============================================================================
--- trunk/t/op/sprintf.t Fri Mar 5 02:43:01 2010 (r44636)
+++ trunk/t/op/sprintf.t Fri Mar 5 05:16:10 2010 (r44637)
@@ -106,8 +106,6 @@
skip_tests = 'set_skip_info'()
# how many tests to run?
- # XXX: this should be summed automatically from test_files data
- # until then, it's set to no plan
test.'plan'(TESTS)
outer_loop:
More information about the parrot-commits
mailing list