summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-10 13:51:32 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-10 13:51:32 +0000
commit45007e96015507405b5fc398fbc6e6402ef5a25f (patch)
treeef021d22c3cb2dc2722de458699b78e109acd59b /TEST-NOTES
parentremove monolithic test (diff)
downloadportage-idfetch-45007e96015507405b5fc398fbc6e6402ef5a25f.tar.gz
portage-idfetch-45007e96015507405b5fc398fbc6e6402ef5a25f.tar.bz2
portage-idfetch-45007e96015507405b5fc398fbc6e6402ef5a25f.zip
add a few tips on adding tests, and kinks in the current system, I hope to fix the import bug soon
svn path=/main/trunk/; revision=5531
Diffstat (limited to 'TEST-NOTES')
-rw-r--r--TEST-NOTES24
1 files changed, 24 insertions, 0 deletions
diff --git a/TEST-NOTES b/TEST-NOTES
new file mode 100644
index 00000000..dbdbf20d
--- /dev/null
+++ b/TEST-NOTES
@@ -0,0 +1,24 @@
+UnitTests
+---------
+
+Portage has some tests that use the unittest framework that ships with python (2.3-2.4ish)
+Tests have a specific naming convention.
+
+in tests/ there is a runTest script that invokes tests/__init__.py
+
+This init looks at a hardcoded list of test dirs to search for tests.
+If you add a new dir and don't see your new tests, make sure that the dir is in this list.
+
+On the subject of adding more directories; the layout is basically 1 directory per portage
+file at this point (we have few files, and even fewer large files). Inside of the dir
+you should have files of the form test_${function}.py.
+
+So if I was to write a vercmp test, and vercmp is in portage_versions.
+
+tests/portage_versions/test_vercmp.py
+
+would be the filename.
+
+The __init__.py file in tests only goes 1 deep (it's non-recursive, in other words). If
+you end up with more directories it will probably break at present. Need to replace the
+'/' in the directory path with a '.' (for proper importing). This should be trivial to fix.