SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/llnl/smith --skill cpp-unit-testing명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | cpp-unit-testing |
| description | Instructions for creating unit tests for Smith |
This repo’s unit tests:
TEST, TEST_F, etc.).tests/ subdirectory.smith_add_tests(...).Place unit tests next to the component they cover:
src/smith/<component>/tests/ (recommended for library code)src/tests/ (project-wide smoke/regression tests)Each tests/ directory should contain:
*.cpp test filesCMakeLists.txt that registers those tests with smith_add_testsAlso ensure the parent component adds the tests subdirectory when tests are enabled:
if(SMITH_ENABLE_TESTS)
add_subdirectory(tests)
endif()
#include <gtest/gtest.h>TEST_F) when setup/teardown is shared.smith_add_testssmith_add_tests creates one test executable per source file and registers it with CTest.
The executable/test name is the source basename (e.g., test_state_manager.cpp → test_state_manager).
Minimal tests/CMakeLists.txt template:
set(my_component_test_depends
smith_my_component
gtest)
set(my_component_test_sources
test_feature_a.cpp
test_feature_b.cpp)
smith_add_tests(SOURCES ${my_component_test_sources}
DEPENDS_ON ${my_component_test_depends}
NUM_MPI_TASKS 1)
Notes:
DEPENDS_ON (the library under test + gtest + any required Smith/TPL targets).If a test requires MPI, add the MPI dependency and set NUM_MPI_TASKS:
smith_add_tests(SOURCES my_parallel_test.cpp
DEPENDS_ON gtest blt::mpi smith_my_component
NUM_MPI_TASKS 4)
If a test requires OpenMP, set NUM_OMP_THREADS accordingly.
If you need a CUDA-enabled unit test, gate it behind SMITH_ENABLE_CUDA and pass USE_CUDA:
if(SMITH_ENABLE_CUDA)
smith_add_tests(SOURCES my_cuda_test.cpp
DEPENDS_ON gtest smith_my_component
USE_CUDA TRUE)
endif()
-DENABLE_TESTS=ON -DSMITH_ENABLE_TESTS=ONctestctest -R test_state_managercmake/SmithMacros.cmakesrc/smith/physics/state/tests/CMakeLists.txtsrc/tests/CMakeLists.txt