Skip to content

chore(dfpt): consolidate module_dfpt tests into unittests/ - #8394

Open
Zanthoxylum wants to merge 1 commit into
deepmodeling:developfrom
Zanthoxylum:chore-dfpt-unittests
Open

Zanthoxylum wants to merge 1 commit into
deepmodeling:developfrom
Zanthoxylum:chore-dfpt-unittests

Conversation

@Zanthoxylum

Copy link
Copy Markdown
Collaborator

Summary

Migrate the legacy test_serial/ (serial, __MPI-off ABI) and test/ (MPI)
directories of source/source_pw/module_dfpt/ into a single unittests/
directory, following the unittests/ layout rule and the module_stodft
precedent in #8334.

  • All 10 addtest targets keep their names (MODULE_DFPT_pert_serial,
    rho_serial, phon_serial, q0_serial, write_dyn_serial,
    xc_analytic_serial, pw_data_test, kq_basis_test, stern_test,
    pw_run_test), so the CTest labels and the CI test matrix are unchanged.
  • The MPI targets opt back into __MPI via KEEP_FEATURE_DEFINITIONS
    while the directory disables it for the serial ABI — the AddTest
    mechanism documented in cmake/Testing.cmake — and stay wrapped in
    ENABLE_MPI as before. The dfpt_planewave_serial OBJECT library moves
    unchanged (same directory depth, same relative source paths).
  • Test sources are renamed to the test_<module>.cpp convention
    (dfpt_kq_basis_test.cpp → test_dfpt_kq_basis.cpp,
    dfpt_pert_serial_test.cpp → test_dfpt_pert.cpp,
    dfpt_pw_data_test.cpp → test_dfpt_pw_data.cpp,
    dfpt_pw_run_test.cpp → test_dfpt_pw_run.cpp,
    dfpt_stern_test.cpp → test_dfpt_stern.cpp); the shared fixtures keep
    their header names and gain test_-prefixed sources
    (test_dfpt_fixture.cpp, test_dfpt_stru_fixture.cpp,
    test_dfpt_mocks.cpp).
  • No test content changes: no case edits, no CMake policy additions,
    no timeout/property settings added. The move is git mv + the CMake
    consolidation only.

No documentation update required: internal test-layout consolidation with
no user-facing behavior change.

Verification

  • Full CMake reconfiguration, then ctest -R MODULE_DFPT: 10/10
    passed
    (both serial and MPI targets).
  • gtest case counts per binary match the develop baseline exactly:
    MODULE_DFPT_phon_serial 20, MODULE_DFPT_rho_serial 11,
    MODULE_DFPT_pert_serial 7.
  • python3 tools/03_code_analysis/agent_governance_check.py --staged:
    no ERROR findings.

Migrate the legacy test_serial/ (serial, __MPI-off ABI) and test/ (MPI)
directories into a single unittests/ directory, following the unittests/
layout rule and the module_stodft precedent in deepmodeling#8334.

- All 10 addtest targets keep their names (MODULE_DFPT_pert_serial,
  rho_serial, phon_serial, q0_serial, write_dyn_serial, xc_analytic_serial,
  pw_data_test, kq_basis_test, stern_test, pw_run_test), so the CTest
  labels and the CI matrix are unchanged.
- The MPI targets opt back into __MPI via KEEP_FEATURE_DEFINITIONS while
  the directory disables it for the serial ABI (the AddTest mechanism
  documented in cmake/Testing.cmake); they stay wrapped in ENABLE_MPI as
  before.
- Test sources are renamed to the test_<module>.cpp convention
  (dfpt_kq_basis_test.cpp -> test_dfpt_kq_basis.cpp etc.); the shared
  fixtures keep their header names and gain test_-prefixed sources
  (test_dfpt_fixture.cpp, test_dfpt_stru_fixture.cpp,
  test_dfpt_mocks.cpp).
- No test content changes: case counts are identical to the baseline
  (phon_serial 20, rho_serial 11, pert_serial 7), and all binaries
  relink against the same source lists.

No documentation update required: internal test-layout consolidation with
no user-facing behavior change.

Verification:
- ctest -R MODULE_DFPT: 10/10 passed after full reconfiguration
- agent_governance_check.py --staged: no ERROR findings
- gtest case counts match the develop baseline per target
@Zanthoxylum Zanthoxylum added Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests DFPT Density Functional Perturbation Theory labels Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DFPT Density Functional Perturbation Theory Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant