mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Add a way to specify a path to the arguments
This commit is contained in:
@@ -31,6 +31,10 @@ def run_tests(args):
|
|||||||
behave_args.extend(args["advanced_arguments"].split())
|
behave_args.extend(args["advanced_arguments"].split())
|
||||||
elif not args["console"]:
|
elif not args["console"]:
|
||||||
behave_args.extend(["--format", "json.pretty", "--outfile", "report/report.json"])
|
behave_args.extend(["--format", "json.pretty", "--outfile", "report/report.json"])
|
||||||
|
if args["ifcfile"]:
|
||||||
|
behave_args.extend(["--define", "ifcfile={}".format(args["ifcfile"])])
|
||||||
|
if args["path"]:
|
||||||
|
behave_args.extend(["--define", "path={}".format(args["path"])])
|
||||||
behave_main(behave_args)
|
behave_main(behave_args)
|
||||||
print("# All tests are finished.")
|
print("# All tests are finished.")
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -48,6 +48,15 @@ if __name__ == "__main__":
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Generate a HTML report after running the tests"
|
help="Generate a HTML report after running the tests"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-path",
|
||||||
|
"--path",
|
||||||
|
type=str,
|
||||||
|
help=(
|
||||||
|
"Specify a path to prepend to feature and ifc file"
|
||||||
|
),
|
||||||
|
default=""
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c",
|
"-c",
|
||||||
"--console",
|
"--console",
|
||||||
@@ -101,6 +110,12 @@ if __name__ == "__main__":
|
|||||||
args = vars(parser.parse_args())
|
args = vars(parser.parse_args())
|
||||||
print(args)
|
print(args)
|
||||||
|
|
||||||
|
if args["path"]:
|
||||||
|
if args["feature"]:
|
||||||
|
args["feature"] = os.path.join(args["path"], args["feature"])
|
||||||
|
if not args["gui"]:
|
||||||
|
args["ifcfile"] = os.path.join(args["path"], args["ifcfile"])
|
||||||
|
|
||||||
if args["purge"]:
|
if args["purge"]:
|
||||||
clean.TestPurger().purge()
|
clean.TestPurger().purge()
|
||||||
elif args["report"]:
|
elif args["report"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user