bimtester: start script, improve arguments

This commit is contained in:
Bernd Hahnebach
2021-01-12 18:32:44 +01:00
parent a54b84b4c3
commit 6ee3c8fd98
+20 -7
View File
@@ -83,25 +83,34 @@ if __name__ == "__main__":
"--gui", "--gui",
action="store_true", action="store_true",
help=( help=(
"Start the gui. The option t (run in temp directory) " "Start the gui. The option t (copyintemprun) "
"is triggered automaticly." "is triggered automaticly."
) )
) )
parser.add_argument( parser.add_argument(
"featuresdir", "-t",
"--copyintemprun",
action="store_true",
help=(
"Copy steps and feature files into a temporary directory "
"and run bimtester with them."
)
)
parser.add_argument(
"-d",
"--featuresdir",
type=str, type=str,
nargs="?",
help=( help=(
"Specify a features directory. This should contain " "Specify a features directory. This should contain "
" a directory named features which contains all the " "a directory named 'features' which contains all the "
"feature files." "feature files."
), ),
default="" default=""
) )
parser.add_argument( parser.add_argument(
"ifcfile", "-i",
"--ifcfile",
type=str, type=str,
nargs="?",
help=( help=(
"Specify a ifc file." "Specify a ifc file."
), ),
@@ -109,7 +118,8 @@ if __name__ == "__main__":
) )
args = vars(parser.parse_args()) args = vars(parser.parse_args())
print(args) from json import dumps
print(dumps(args, indent=4))
if args["path"]: if args["path"]:
if args["feature"]: if args["feature"]:
@@ -123,8 +133,11 @@ if __name__ == "__main__":
reports.generate_report() reports.generate_report()
elif args["gui"]: elif args["gui"]:
show_widget(args["featuresdir"], args["ifcfile"]) show_widget(args["featuresdir"], args["ifcfile"])
elif args["copyintemprun"]:
run.run_copyintmp_tests(args)
else: else:
run.run_tests(args) run.run_tests(args)
if args["report_after_run"]: if args["report_after_run"]:
reports.generate_report() reports.generate_report()
print("# All tasks are complete :-)") print("# All tasks are complete :-)")