Merge branch 'v0.6.0' of github.com:IfcOpenShell/IfcOpenShell into v0.6.0

This commit is contained in:
Dion Moult
2020-11-26 21:31:52 +11:00
8 changed files with 108 additions and 36 deletions
+18
View File
@@ -0,0 +1,18 @@
# BIMTester
### Packages to be installed
+ behave
+ pystache
+ ifcopenshell
### Start bimtester Gui from a shell
```
python3 ./bimtester.py -g
```
### 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`
+60 -11
View File
@@ -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
@@ -12,14 +7,66 @@ from bimtester import reports
from bimtester import run
def show_widget():
import sys
from PySide2 import QtWidgets
from bimtester.guiwidget import GuiWidgetBimTester
# Create the Qt Application
app = QtWidgets.QApplication(sys.argv)
# Create and show the form
form = GuiWidgetBimTester()
form.show()
# Run the main Qt loop
sys.exit(app.exec_())
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=""
)
parser.add_argument(
"-g",
"--gui",
action="store_true",
help="Start with gui",
)
args = vars(parser.parse_args())
@@ -27,6 +74,8 @@ if __name__ == "__main__":
clean.TestPurger().purge()
elif args["report"]:
reports.generate_report()
elif args["gui"]:
show_widget()
else:
run.run_tests(args)
print("# All tasks are complete :-)")
@@ -1,6 +1,9 @@
import json
from behave import step
from utils import IfcFile, assert_attribute, assert_type
from utils import assert_attribute
from utils import assert_type
from utils import IfcFile
def get_classification(name):
@@ -1,5 +1,8 @@
from behave import step
from utils import IfcFile, assert_attribute, assert_type
from utils import assert_attribute
from utils import assert_type
from utils import IfcFile
@step("The element {guid} is an {ifc_class} only")
@@ -1,6 +1,7 @@
from behave import step
from utils import assert_attribute
from utils import IfcFile
from utils import IfcFile, assert_attribute
@step('The IFC file "{file}" must be provided')
@@ -1,4 +1,5 @@
from behave import step
from utils import IfcFile
+19
View File
@@ -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
-22
View File
@@ -1,22 +0,0 @@
# TODO merge into bimtester module
import sys
from PySide2 import QtWidgets
from bimtester.guiwidget import GuiWidgetBimTester
def show_widget():
# Create the Qt Application
app = QtWidgets.QApplication(sys.argv)
# Create and show the form
form = GuiWidgetBimTester()
form.show()
# Run the main Qt loop
sys.exit(app.exec_())
if __name__ == '__main__':
show_widget()