-
Notifications
You must be signed in to change notification settings - Fork 1
/
pavement.py
52 lines (41 loc) · 1.34 KB
/
pavement.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from paver.easy import *
from paver.path import path
import os
@task
@cmdopts([
('format=', 'f', 'output format [silent, verbose, xunit]')
])
def test(options):
format = options.test.format if 'format' in options.test else 'silent'
opts = ['--with-doctest']
if format == 'verbose': opts.append('--verbose')
if format == 'xunit': opts.append('--with-xunit')
files = path('python/mkakeibo').walk('*.py')
sh('nosetests %s %s'%(' '.join(opts), ' '.join(files)))
@task
@cmdopts([
('build-id=', 'b', '')
])
def build(options):
if path('build').exists():
sh('rm -rf build')
sh('mkdir -p build/python')
sh('paver sdist', cwd='python')
sh('cp python/dist/* build/python')
sh('mkdir -p dist')
sh('tar cvfz dist/mkakeibo.b%(build_id)s.tar.gz -C build .'%options.build)
FITNESSE_OPTS = [
'-p 20942'
]
FITNESSE_RUNNING_OPTS = FITNESSE_OPTS + [
'-d %s'%(path('test/fitnesse').abspath()),
]
@task
def start_fitnesse(options):
sh('start-fitnesse ' + ' '.join(FITNESSE_RUNNING_OPTS))
@task
def stop_fitnesse(options):
sh('stop-fitnesse ' + ' '.join(FITNESSE_OPTS))
@task
def fitnesse(options):
sh('run-fitnesse ' + ' '.join(FITNESSE_RUNNING_OPTS) + ' -c "MkakeiboTop.AcceptanceTests?suite&format=xml" | awk "/^<\?xml/{out=1}/^<\/testResults>/{print;out=0}out==1{print}" > fitnesse-result.xml')