mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Add junit dir argument
This commit is contained in:
@@ -12,21 +12,21 @@ import argparse
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
def run_tests(args):
|
def run_tests(args):
|
||||||
behave_args = ['features', '--junit', '--junit-directory', 'junit/']
|
behave_args = ['features', '--junit', '--junit-directory', args.junit_directory]
|
||||||
if args.advanced_arguments:
|
if args.advanced_arguments:
|
||||||
behave_args = args.advanced_arguments.split()
|
behave_args = args.advanced_arguments.split()
|
||||||
behave_main(behave_args)
|
behave_main(behave_args)
|
||||||
print('# All tests are finished.')
|
print('# All tests are finished.')
|
||||||
if args.report:
|
if args.report:
|
||||||
generate_report()
|
generate_report(args)
|
||||||
|
|
||||||
def generate_report():
|
def generate_report(args):
|
||||||
print('# Generating HTML reports now.')
|
print('# Generating HTML reports now.')
|
||||||
if not os.path.exists('report'):
|
if not os.path.exists('report'):
|
||||||
os.mkdir('report')
|
os.mkdir('report')
|
||||||
if not os.path.exists('junit'):
|
if not os.path.exists(args.junit_directory):
|
||||||
os.mkdir('junit')
|
os.mkdir(args.junit_directory)
|
||||||
for file in os.listdir('junit/'):
|
for file in os.listdir(args.junit_directory):
|
||||||
if not file.endswith('.xml'):
|
if not file.endswith('.xml'):
|
||||||
continue
|
continue
|
||||||
root = ET.parse('junit/{}'.format(file)).getroot()
|
root = ET.parse('junit/{}'.format(file)).getroot()
|
||||||
@@ -105,6 +105,12 @@ parser.add_argument(
|
|||||||
'--report',
|
'--report',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Generate a HTML report')
|
help='Generate a HTML report')
|
||||||
|
parser.add_argument(
|
||||||
|
'-j',
|
||||||
|
'--junit-directory',
|
||||||
|
type=str,
|
||||||
|
help='Specify your own JUnit directory',
|
||||||
|
default='junit/')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-a',
|
'-a',
|
||||||
'--advanced-arguments',
|
'--advanced-arguments',
|
||||||
|
|||||||
Reference in New Issue
Block a user