mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
bimtester: code formating and comments
This commit is contained in:
committed by
Dion Moult
parent
e346d5e3c6
commit
15199152ac
@@ -0,0 +1,13 @@
|
||||
# BIMTester
|
||||
### Packages to be installed
|
||||
+ behave
|
||||
+ pystache
|
||||
+ ifcopenshell
|
||||
|
||||
|
||||
### Create a binary out of the Python package
|
||||
+ The commands needs to be updated
|
||||
+ Unix:
|
||||
`$ pyinstaller --onefile --clean --icon=icon.ico --add-data "features:features" bimtester.py`
|
||||
+ Windows:
|
||||
`$ pyinstaller --onefile --clean --icon=icon.ico --add-data "features;features" bimtester.py`
|
||||
@@ -1,10 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Unix:
|
||||
# $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features:features" bimtester.py`
|
||||
# Windows:
|
||||
# $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features;features" bimtester.py`
|
||||
|
||||
import argparse
|
||||
|
||||
from bimtester import clean
|
||||
@@ -13,13 +8,41 @@ from bimtester import run
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Runs unit tests for BIM data")
|
||||
parser.add_argument("-p", "--purge", action="store_true", help="Purge tests of deleted elements")
|
||||
parser.add_argument("-r", "--report", action="store_true", help="Generate a HTML report")
|
||||
parser.add_argument("-c", "--console", action="store_true", help="Show results in the console")
|
||||
parser.add_argument("-f", "--feature", type=str, help="Specify a feature file to test", default="")
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Runs unit tests for BIM data"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-a", "--advanced-arguments", type=str, help="Specify your own arguments to Python's Behave", default=""
|
||||
"-p",
|
||||
"--purge",
|
||||
action="store_true",
|
||||
help="Purge tests of deleted elements"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--report",
|
||||
action="store_true",
|
||||
help="Generate a HTML report"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--console",
|
||||
action="store_true",
|
||||
help="Show results in the console"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-f",
|
||||
"--feature",
|
||||
type=str,
|
||||
help="Specify a feature file to test",
|
||||
default=""
|
||||
)
|
||||
parser.add_argument(
|
||||
"-a",
|
||||
"--advanced-arguments",
|
||||
type=str,
|
||||
help="Specify your own arguments to Python's Behave",
|
||||
default=""
|
||||
)
|
||||
args = vars(parser.parse_args())
|
||||
|
||||
|
||||
@@ -107,6 +107,25 @@ run.run_all(myfeatures_path, myfeatures_path)
|
||||
# like German Umlaute behave gives an error
|
||||
|
||||
|
||||
# TODO: change run_intmp_tests() and run_all()
|
||||
# arguments feature_path and ifc_file
|
||||
#
|
||||
# both is given:
|
||||
# replace the ifc in feature files
|
||||
#
|
||||
# feature_path only is given:
|
||||
# use the ifc provided in the feature files
|
||||
#
|
||||
# ifc_file only is given:
|
||||
# assume feature files are in the directory of the ifc
|
||||
#
|
||||
# none of both is given:
|
||||
# use current directory and the ifc from feature files
|
||||
|
||||
|
||||
# TODO: add arg for run_intmp_tests() to bimtester.py
|
||||
|
||||
|
||||
def run_intmp_tests(args={}):
|
||||
|
||||
from behave import __version__ as behave_version
|
||||
|
||||
Reference in New Issue
Block a user