Testing extensions

Patrick Mézard patrick.mezard at gmail.com
Wed Dec 26 13:38:23 CST 2007


Hello,

Is there a canonical way to write extensions tests and run them ?

For instance, the forest extension module and test-forest are in the same directory (there are also other tests in tests/). Calling run-tests.py from the extension root directory works fine but has several limitations:

- tests and tools living in the same directory is no longer true. It means extension tests cannot use mercurial tools like hghave or simplemerge. Test coverage cannot be generated.
- the extension code is not installed. It works with forest because run-tests.py is executed in the extension module directory, which is added to sys.path. I am not convinced requiring the extension code to be with tests is a good practice.
- what about extensions with a setup/compilation process ?

First point can be solved with a separate environment variable, but I prefer to hear about extension writers before moving forward. It would be great that a collection of extensions could be tested against a given mercurial version without installing any of them.

--
Patrick Mézard


More information about the Mercurial-devel mailing list