Commit 607f926
Add two testing features (#424)
* Add the loading of the test file as a test in itself.
Currently when loading unittest (for python) into gtest (c++), a failure while
loading the test in python does not generates a test failure which is problematic
as load time error will be unnoticed.
The introduced changes add the loading as an individual test.
* Transform error as a warning as we now have a better way to makes a test fail.
* Remove BOM from an utf8 file (makes tests fails otherwise)
* Add method import_sofa_python_scene(path_to_scene : str) in the python package Sofa
The introduced method loads dynamically python module containing a scene
and returns it.
This allows to do:
```python
scene = import_sofa_python_scene("myscene.py")
root = scene.createScene(Sofa.Core.Node("root"))
...
root.addObject(....)
```
* Update bindings/Sofa/package/__init__.py
Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
* Example of use of Sofa.import_python_scene
---------
Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>1 parent 95b7a14 commit 607f926
5 files changed
Lines changed: 31 additions & 2 deletions
File tree
- Testing/src/SofaPython3Testing
- bindings/Sofa
- package
- tests/Core
- examples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments