Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaCore] Move function definition in cpp files #2041

Merged
merged 3 commits into from
May 4, 2021

Conversation

alxbilger
Copy link
Contributor

BroadPhaseDetection and NarrowPhaseDetection classes did not have any source files. The class member functions were defined in the header file.
I created the associated cpp files and moved the definitions into them.
I also added the symbol exports.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added the pr: clean Cleaning the code label Apr 23, 2021
@hugtalbot hugtalbot added the pr: status to review To notify reviewers to review this pull-request label Apr 23, 2021
@alxbilger
Copy link
Contributor Author

[ci-build][with-all-tests]

@guparan
Copy link
Contributor

guparan commented May 3, 2021

Any idea why SofaPython3/Bindings.Sofa.Tests tests are failing?

The output:

Running unit-tests Bindings.Sofa.Tests
Calling: bash -c "/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/bin/Bindings.Sofa.Tests --gtest_output=xml:unit-tests/Bindings.Sofa.Tests/report.xml 2>&1"

[INFO]    [SofaPython3]  Initializing with python version 3.8.6 (default, Oct 27 2020, 09:13:12) 
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
[INFO]    [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files.
[INFO]    [SofaPython3] Shared library name is 'libpython3.8m.so'
[INFO]    [SofaPython3] Intializing python
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/src/applications/plugins/image/python' to sys.path
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/src/applications/plugins/SofaPython/python' to sys.path
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/src/applications/plugins/Registration/python' to sys.path
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/src/applications/plugins/RigidScale/python' to sys.path
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/src/applications/plugins/Flexible/python' to sys.path
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/src/applications/plugins/Compliant/python' to sys.path
[INFO]    [SofaPython3] Added '/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/lib/python3/site-packages' to sys.path
[INFO]    [PluginManager] Loaded plugin: /builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/lib/libSofaPython3.so
[INFO]    [SofaPython3]  Initializing with python version 3.8.6 (default, Oct 27 2020, 09:13:12) 
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
[INFO]    [SofaPython3] Shared library name is 'libpython3.8m.so'
[ERROR]   [PythonTestExtractor] File skipped: /builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/bin/Components/Components.py  
ModuleNotFoundError: No module named 'Sofa.Components'

At:
  Components.py(4): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(783): exec_module
  <frozen importlib._bootstrap>(686): _load_unlocked
  <frozen importlib._bootstrap>(702): _load
  /opt/rh/rh-python38/root/usr/lib64/python3.8/imp.py(171): load_source
  /opt/rh/rh-python38/root/usr/lib64/python3.8/imp.py(234): load_module
  <string>(3): <module>

[ERROR]   [PythonTestExtractor] File skipped: /builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/bin/Core/MyRestShapeForceField.py  
No test suite found. Make sure there is at least one class in the script that inherits from TestCase.
[INFO]    [PythonTestExtractor] File 'Base.py' loaded with 10 unit tests.
[INFO]    [PythonTestExtractor] File 'PythonRestShapeForceField.py' loaded with 1 unit tests.
[INFO]    [PythonTestExtractor] File 'BaseData.py' loaded with 29 unit tests.
[INFO]    [PythonTestExtractor] File 'DataEngine.py' loaded with 3 unit tests.
[INFO]    [PythonTestExtractor] File 'BaseLink.py' loaded with 11 unit tests.
[INFO]    [PythonTestExtractor] File 'BaseObject.py' loaded with 12 unit tests.
[INFO]    [PythonTestExtractor] File 'Controller.py' loaded with 7 unit tests.
[INFO]    [PythonTestExtractor] File 'ForceField.py' loaded with 3 unit tests.
[INFO]    [PythonTestExtractor] File 'FileRepository.py' loaded with 3 unit tests.
[INFO]    [PythonTestExtractor] File 'Message.py' loaded with 2 unit tests.
[INFO]    [PythonTestExtractor] File 'Node.py' loaded with 26 unit tests.
[INFO]    [PythonTestExtractor] File 'Simulation.py' loaded with 1 unit tests.
[INFO]    [PythonTestExtractor] File 'RGBAColor.py' loaded with 3 unit tests.
[INFO]    [PythonTestExtractor] File 'Vec3.py' loaded with 4 unit tests.
[INFO]    [PythonTestExtractor] File 'BoundingBox.py' loaded with 5 unit tests.
[==========] Running 120 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 120 tests from SofaPython3/Sofa
[INFO]    [SofaPython3]  Initializing with python version 3.8.6 (default, Oct 27 2020, 09:13:12) 
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
[INFO]    [SofaPython3] Shared library name is 'libpython3.8m.so'
[ RUN      ] SofaPython3/Sofa.all_tests/0_Sofa_Core_Base_test_addExistingDataAsParentOfNewData
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK
[       OK ] SofaPython3/Sofa.all_tests/0_Sofa_Core_Base_test_addExistingDataAsParentOfNewData (2 ms)
[ RUN      ] SofaPython3/Sofa.all_tests/1_Sofa_Core_Base_test_addKeywordProtected
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK
[       OK ] SofaPython3/Sofa.all_tests/1_Sofa_Core_Base_test_addKeywordProtected (1 ms)
[ RUN      ] SofaPython3/Sofa.all_tests/2_Sofa_Core_Base_test_addNewDataFromParent
======================================================================
ERROR: test_addNewDataFromParent (Base.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Base.py", line 83, in test_addNewDataFromParent
    c1 = root.addObject("MechanicalObject", name="c1")
ValueError: Object type MechanicalObject<> was not created  
The object is not in the factory.  


----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
/builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/bin/Core/Base.py:0: Failure
Failed
[  FAILED  ] SofaPython3/Sofa.all_tests/2_Sofa_Core_Base_test_addNewDataFromParent, where GetParam() = /builds/workspace/sofa-framework/PR-2041/centos_clang-5_options_release/build/bin/Core/Base.py with args {test_addNewDataFromParent, } (2 ms)

@fredroy
Copy link
Contributor

fredroy commented May 3, 2021

I don't really think it is related to this PR, it has been quite a long time now that some SofaPython3 tests are failing, especially on macOS.
It does not happen on Ubuntu though apparently.
And it seems there is no unit tests of SofaPython3 on Windows ...

@guparan guparan merged commit f87ca5b into sofa-framework:master May 4, 2021
@guparan guparan added this to the v21.06 milestone Jun 28, 2021
@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels May 13, 2022
@alxbilger alxbilger deleted the cpp_files branch June 28, 2022 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants