Hi,
following this recent issue for STEP interchange:
https://freecadweb.org/tracker/view.php?id=3426
I would like to add some example code & macros to enable a sort of automatic check if some basic feature are still available when a new FC release is going to be deployed...
Something similar to FEM testing files and routines...
What I'm going to add it would be:
1) test in loading a simple single object STEP file (checking the objects loaded in FC)
2) test in loading a multiple objects STEP file (checking the objects loaded in FC)
3) test in loading a hierarchy of objects STEP file (checking the objects loaded in FC)
4) test in saving a simple single object STEP file (checking when reloaded, the objects loaded in FC)
5) test in saving a multiple objects STEP file (checking when reloaded, the objects loaded in FC)
6) test in saving a hierarchy of objects STEP file (checking when reloaded, the objects loaded in FC)
7) test in saving a compound of objects STEP file (checking when reloaded, the objects loaded in FC)
In which way these checking could be added to FC checking?
Thx in advance
Maurice
how to add STEP import/export FC check
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: how to add STEP import/export FC check
The best would be to create some simple STEP files and put them to the data/examples directory. Then create a file TestImport.py and put it into the Import module.In which way these checking could be added to FC checking?
Write some unit tests to check all these cases. You can look at some other unit tests to see how to do it.
Re: how to add STEP import/export FC check
Thanks Wernerwmayer wrote: ↑Mon Apr 16, 2018 5:03 pmThe best would be to create some simple STEP files and put them to the data/examples directory. Then create a file TestImport.py and put it into the Import module.In which way these checking could be added to FC checking?
Write some unit tests to check all these cases. You can look at some other unit tests to see how to do it.
I will have a look at 'TestFem.py' ...
Then I could:
1) add 'TestImport.py' at 'FreeCAD\Mod\Import' folder
2) add 'steptest' folder with some testing scritps inside
3) add 'testfiles' folder inside 'steptest' folder with some STEP files inside
Does it sound fine?
Thx
Maurice
Re: how to add STEP import/export FC check
Sounds good.
Re: how to add STEP import/export FC check
There's no GUI on the CI engines, so you would need to only run the test if the GUI is up. I think there are other tests like this, more tests are run from the GUI than the command line.
"fight the good fight"
Re: how to add STEP import/export FC check
Is there a way to check a Face and a Shape color without the Gui up?
Re: how to add STEP import/export FC check
You can also use Gui in the unit tests. We do this in a lot of other places, too. However, it would be best to create a file TestImportGui.py to separate GUI stuff from non-GUI stuff.