This is the second part of my fixes for issue 2872... I think I have most of the stuff covered now.
Regard the change in runtest.py, where I removed the additional setting of paths for QMTest. I hope this doesn't break anything, but the old version has already bitten me once or twice. The problem was that runtest.py would find the systemwide QMTest dir first, if SCons was already installed!
Not very helpful if you are changing and testing the testing framework itself. ;)
The rest are simple refactorings or smaller changes, mainly relaxing the regular expressions for comparing the expected output...