mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-13 07:17:26 +02:00
Added a --plugins-dir option to supybot-test so plugins don't have to be specified individually.
This commit is contained in:
parent
e13c958c9d
commit
7ed4967877
@ -109,6 +109,7 @@ class path(str):
|
|||||||
return self._r.split(self) == self._r.split(other)
|
return self._r.split(self) == self._r.split(other)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
import glob
|
||||||
import os.path
|
import os.path
|
||||||
import optparse
|
import optparse
|
||||||
import supybot.test as test
|
import supybot.test as test
|
||||||
@ -129,7 +130,19 @@ if __name__ == '__main__':
|
|||||||
help='Traces all calls made. Unless you\'re really in '
|
help='Traces all calls made. Unless you\'re really in '
|
||||||
'a pinch, you probably shouldn\'t do this; it results '
|
'a pinch, you probably shouldn\'t do this; it results '
|
||||||
'in copious amounts of output.')
|
'in copious amounts of output.')
|
||||||
|
parser.add_option('', '--plugins-dir',
|
||||||
|
action='append', dest='pluginsDirs', default=[],
|
||||||
|
help='Looks in in the given directory for plugins and '
|
||||||
|
'loads the tests from all of them.')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
# This must go before checking for args, of course.
|
||||||
|
for pluginDir in options.pluginsDirs:
|
||||||
|
for name in glob.glob(os.path.join(pluginDir, '*')):
|
||||||
|
#print '***', name
|
||||||
|
if os.path.isdir(name):
|
||||||
|
args.append(name)
|
||||||
|
|
||||||
if not args:
|
if not args:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user