Skip to content

Conversation

@dssgabriel
Copy link
Collaborator

@dssgabriel dssgabriel commented Dec 2, 2025

This PR adds a custom CMake helper function for easily adding new unit tests.

I made it as flexible as possible, so it should cover all cases we may encounter for existing and future unit tests. Also added some custom gersemi definitions so our CMake formatter can parse and format these function calls properly.

Applied this new function to all our existing unit tests and renamed them using the following format: $kind.$module.$name, where:

  • kind: {smoke,test}
  • module: {core,mpi,nccl}

Example call for the pending PR #191 that adds the "core" broadcast unit test:

kc_add_unit_test(
  test.core.broadcast                     # Full test name
  CORE                                    # Test module
  NUM_PES 2                               # Number of Processing Elements (PEs) to run the test with
  FILES test_main.cpp test_broadcast.cpp  # Files defining the test
)

@dssgabriel dssgabriel self-assigned this Dec 2, 2025
@dssgabriel dssgabriel added C-enhancement Category: an enhancement or bug fix A-unit-tests Area: KokkosComm unit tests labels Dec 2, 2025
@dssgabriel dssgabriel changed the title feat(build): custom CMake helper for adding unit tests build(unit_tests): custom CMake helper for adding unit tests Dec 2, 2025
@dssgabriel dssgabriel force-pushed the feature/add-test-helper branch from 56bd5b9 to c280c34 Compare December 2, 2025 17:36
@cwpearson cwpearson added the SNL-CI-APPROVAL Required to run SNL CI on non-SNL contributions label Dec 4, 2025
@cedricchevalier19 cedricchevalier19 merged commit e1fefb9 into kokkos:develop Dec 8, 2025
11 of 13 checks passed
@dssgabriel dssgabriel deleted the feature/add-test-helper branch December 8, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-unit-tests Area: KokkosComm unit tests C-enhancement Category: an enhancement or bug fix SNL-CI-APPROVAL Required to run SNL CI on non-SNL contributions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants