mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
bimtester: run, merge run behave commands
This commit is contained in:
@@ -4,7 +4,6 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import webbrowser
|
import webbrowser
|
||||||
from behave.__main__ import main as behave_main
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: if the ifc file name or path contains special character
|
# TODO: if the ifc file name or path contains special character
|
||||||
@@ -35,6 +34,8 @@ def run_tests(args):
|
|||||||
if not get_features(args):
|
if not get_features(args):
|
||||||
print("No features could be found to check.")
|
print("No features could be found to check.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# get behave args
|
||||||
behave_args = [get_resource_path("features")]
|
behave_args = [get_resource_path("features")]
|
||||||
if args["advanced_arguments"]:
|
if args["advanced_arguments"]:
|
||||||
behave_args.extend(args["advanced_arguments"].split())
|
behave_args.extend(args["advanced_arguments"].split())
|
||||||
@@ -53,8 +54,26 @@ def run_tests(args):
|
|||||||
behave_args.extend(["--define", "ifcfile={}".format(args["ifcfile"])])
|
behave_args.extend(["--define", "ifcfile={}".format(args["ifcfile"])])
|
||||||
if args["path"]:
|
if args["path"]:
|
||||||
behave_args.extend(["--define", "path={}".format(args["path"])])
|
behave_args.extend(["--define", "path={}".format(args["path"])])
|
||||||
|
|
||||||
|
# run tests
|
||||||
|
if behave_args != []:
|
||||||
|
run_behave(behave_args)
|
||||||
|
else:
|
||||||
|
print("Error, not able to run behave because of empty behave args.")
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def run_behave(behave_args):
|
||||||
|
|
||||||
|
from json import dumps
|
||||||
|
print(dumps(behave_args, indent=4))
|
||||||
|
|
||||||
|
from behave.__main__ import main as behave_main
|
||||||
behave_main(behave_args)
|
behave_main(behave_args)
|
||||||
print("# All tests are finished.")
|
print("# All tests are finished.")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -270,13 +289,13 @@ def run_copyintmp_tests(args={}):
|
|||||||
])
|
])
|
||||||
if "advanced_arguments" in args:
|
if "advanced_arguments" in args:
|
||||||
behave_args.extend(args["advanced_arguments"].split())
|
behave_args.extend(args["advanced_arguments"].split())
|
||||||
from json import dumps
|
|
||||||
print(dumps(behave_args, indent=4))
|
|
||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
from behave.__main__ import main as behave_main
|
if behave_args != []:
|
||||||
behave_main(behave_args)
|
run_behave(behave_args)
|
||||||
print("All tests are finished.")
|
else:
|
||||||
|
print("Error, not able to run behave because of empty behave args.")
|
||||||
|
return False
|
||||||
|
|
||||||
return copy_base_path
|
return copy_base_path
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user