diff --git a/src/ifcbimtester/README.md b/src/ifcbimtester/README.md new file mode 100644 index 0000000000..079f7f54bf --- /dev/null +++ b/src/ifcbimtester/README.md @@ -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` diff --git a/src/ifcbimtester/bimtester.py b/src/ifcbimtester/bimtester.py index c33121b6fd..792886ef02 100644 --- a/src/ifcbimtester/bimtester.py +++ b/src/ifcbimtester/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()) diff --git a/src/ifcbimtester/bimtester/run.py b/src/ifcbimtester/bimtester/run.py index c64c54372f..4d4cbea046 100644 --- a/src/ifcbimtester/bimtester/run.py +++ b/src/ifcbimtester/bimtester/run.py @@ -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