Skip to content

Conversation

LecrisUT
Copy link
Collaborator

This is an example of using googletest test parameterized test fixture. With this it should be easier to get the test data from the test files that are used in python.

See /test/functional/test_dataset_access.cpp for example usage.

TODO:
  • Dataset test fixture
    • spg_get_dataset
    • spg_get_layer_dataset
    • spgat_get_dataset
    • spg_get_dataset_with_hall_number
    • spgat_get_dataset_with_hall_number
    • from_file
  • MagneticDataset test fixture
    • spg_get_magnetic_dataset
    • spgms_get_magnetic_dataset
    • from_file?
  • SpglibSpacegroupType test fixture
  • SpglibMagneticSpacegroupType test fixture
  • Symmetry test fixture
  • MagneticSymmetry test fixture
  • Cell test fixture
  • MatINT test fixture
  • VecDBL test fixture
  • OverlapChecker test fixture
  • DataContainer test fixture
  • Primitive test fixture
  • ExtraStructure test fixture

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (d6fcbe8) 86.09% compared to head (17291d9) 86.07%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #303      +/-   ##
===========================================
- Coverage    86.09%   86.07%   -0.02%     
===========================================
  Files           23       23              
  Lines         6069     6069              
===========================================
- Hits          5225     5224       -1     
- Misses         844      845       +1     
Flag Coverage Δ
c_api 76.48% <ø> (-0.02%) ⬇️
fortran_api 37.46% <ø> (ø)
python_api 82.83% <ø> (ø)
unit_tests 76.48% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@LecrisUT LecrisUT mentioned this pull request Jun 19, 2023
1 task
LecrisUT added 2 commits June 19, 2023 11:04
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
@LecrisUT LecrisUT closed this Jun 19, 2023
@LecrisUT LecrisUT deleted the test-fixture branch June 19, 2023 13:53
@LecrisUT LecrisUT mentioned this pull request Jun 20, 2023
1 task
@LecrisUT LecrisUT restored the test-fixture branch June 22, 2023 19:56
@LecrisUT LecrisUT reopened this Jun 22, 2023
@atztogo
Copy link
Collaborator

atztogo commented Sep 28, 2023

Is the goal of this fully replace pytest, or to have at least a set of tests for every API functions?

@LecrisUT
Copy link
Collaborator Author

Yes, the goal is to replace them for the main C interface. We can run more complete checks with specific compiler flags, while the other api tests should test only that, api specific stuff, including memory allocation/deallocation to the language native objects.

@atztogo
Copy link
Collaborator

atztogo commented Sep 30, 2023

If so, it will not be a small work.

@LecrisUT
Copy link
Collaborator Author

LecrisUT commented Sep 30, 2023

Well, no. These are all functional (regression tests), so the only missing part is getting input data and compared data which are already present in the python database. That is not so difficult, I just need to actually sit down and do it.

However, these are not appropriate tests to rely on for the long-run, since it is hard to pin down where things are breaking and they are vulnerable to numerical fluctuations. The difficult work is to do proper unit (+ integration) testing, which requires going into each component and writing minimal tests. The framework for that is already in place it's just time and work needed to go through each one. I am not tackling this issue for now, but if I have some time to do #301 (#262) that will be unit tested as it evolves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issue and PR
Development

Successfully merging this pull request may close these issues.

3 participants