Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/tests/cmdline/README view on Meta::CPAN
A. Tree node structure
Each "tree node" in a tree has these fields:
- name : the name of the node
- children: list of child nodes (if the node is a dir)
- contents: textual contents (if the node is a file)
- properties: a hash to hold subversion props
- atts: a hash of meta-information about tree nodes themselves
B. Parsing subcommand output into a tree
Special parsers examine lines printed by subcommands, and
convert them into a tree of tree-nodes. The 'contents' and
'properties' fields are empty; but prepending on the subcommand,
specific attributes in the 'atts' field are set in tree-nodes:
- svn co/up: a 'status' attribute is set to a two-character
value from the set (A, D, G, U, C, _, ' ') or
a 'verb' attribute is set to ('Restored')
- svn status: a 'status' attribute (as above), plus 'wc_rev'
and 'repos_rev' attributes to hold the wc
and repos revision numbers.
- svn ci/im: a 'verb' attribute is set to one of
(Adding, Sending, Deleting)
C. Parsing a working copy into a tree
We also have a routines that walks a regular working copy and
returns a tree representing disk contents and props. In this
case the 'atts' hash in each node is empty, but the 'contents'
and 'props' fields are filled in.
How to Write New Tests
======================
If you'd like to write a new python test, first decide which file it
might fit into; test scripts each contain collections of tests grouped
by rough categories. (Is it testing a new subcommand? New
enhancement? Tricky use-case? Regression test?)
Next, read the long documentation comment at the top of
svntest/tree.py. It will explain the general API that most tests use.
Finally, try copying-and-pasting a simple test and then edit from
there. Don't forget to add your test to the 'test_list' variable at
the bottom of the file. To avoid renumbering of existing tests, you
should add new tests to the end of the list.
Testing Compatability With Previous Release
===========================================
You can run the Python test suite against older installed versions of
the Subversion servers. This mail fragment introduces the ability:
Message-ID: <1ea387f60804091828q48c9d18ah7bf8d89ef7d39461@mail.gmail.com>
Date: Wed, 9 Apr 2008 18:28:40 -0700
From: "David Glasser" <glasser@davidglasser.net>
To: "Subversion Developers" <dev@subversion.tigris.org>
Subject: backwards-compatibility testing!
I've updated the expectations on trunk so that you can cleanly run the
test suite against 1.4.x svnserve or DAV. You do this by adding
SERVER_MINOR_VERSION=4 with make check, or --server-minor-version 4 to
run_tests.py or a specific Python test.
[...]
We expect that post-1.5, this support will expand in the obvious ways
(allowing "--server-minor-version 5" and SERVER_MINOR_VERSION=5).
( run in 0.955 second using v1.01-cache-2.11-cpan-b16cb0d3907 )