Hi,
Having a better solution for this would be great, but with the help of jam and vila I just knocked this up:
if __name__ == '__main__': import os import subprocess import sys dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "plugins") retcode = subprocess.call("bzr selftest -s bzrlib.plugins.<plugin name>", shell=True, env={"BZR_PLUGIN_PATH": dir}) sys.exit(retcode)
Put that at the top of __init__.py (before any "import bzrlib.plugins.<plugin name>" type imports), with a symlink in the branch that points
./plugins/<plugin name> -> ./
so that it is loaded under the correct name. The "python __init__.py" will run the tests.
This obviously doesn't work on windows, so it's not good for wide adoption.
Thanks,
James
Hi,
Having a better solution for this would be great, but with the help of
jam and vila I just knocked this up:
if __name__ == '__main__': join(os. path.dirname( os.path. abspath( __file_ _)), "plugins") call("bzr selftest -s bzrlib. plugins. <plugin name>",
shell= True, env={"BZR_ PLUGIN_ PATH": dir})
sys.exit( retcode)
import os
import subprocess
import sys
dir = os.path.
retcode = subprocess.
Put that at the top of __init__.py (before any "import bzrlib. plugins. <plugin name>"
type imports), with a symlink in the branch that points
./plugins/ <plugin name> -> ./
so that it is loaded under the correct name. The "python __init__.py" will run the
tests.
This obviously doesn't work on windows, so it's not good for wide adoption.
Thanks,
James