1. Introduction
The testsuite is a set of several simple unit tests. Most of the tests were written when a typo was been found, so that we hope next time it’ll be detected automatically. When a problem was found, a test was created and the test failed. After the problem was fixed the test passed. The statistics section contains special tests: we are aware that they do not pass, but their actual output is interesting for us. The output of the testsuite is sent to the frugalware-devel@ mailing list daily.
Since the tests in the testsuite section should pass, if one fails it is expected to be fixed within a day, especially if your name is listed next to a line.
You can find the tests under the /t directory of FST, the statistics are under /t/s.
2. Rules
Basically there are 3 simple rules for these tests:
-
If the first argument is --help, they should print a short (less than 80 chars) description. This will be displayed if the test fails as sometimes the name of the test may not be descriptive enough.
-
The tests are called in a ./testname form, without any argument. This allows you to use various interpreted programming languages (python, bash, etc.).
-
If the test passes, there should be no output. This means that there may be a -v or --verbose option to generate output even if the test passes, that’s not a problem. If the test fails there must be some output. For example if there are problematic packages, then it’s recommended to list each package in a separate line with their path under FST.
3. Technical details
Given that all the files in the fdb and fpm files are owned by root, if you want to operate on them, then you need to use fakeroot. The testsuite wrapper won’t do this for you. A common practice is to write a generic python script that operates on the fdb, then create a shell wrapper for each arch, which will call the python script via fakeroot.