From 45007e96015507405b5fc398fbc6e6402ef5a25f Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Wed, 10 Jan 2007 13:51:32 +0000 Subject: [PATCH] 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 --- TEST-NOTES | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 TEST-NOTES diff --git a/TEST-NOTES b/TEST-NOTES new file mode 100644 index 000000000..dbdbf20d0 --- /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. -- 2.26.2