2023-04-24

[UNITY] TESTCASE 구조 프로젝트 만드는법

project/
├── CMakeLists.txt
├── app/
│   ├── CMakeLists.txt
│   └── myfunc.c
├── include/
│   ├── myfunc.h
│   └── unity.h
├── test/
│   ├── CMakeLists.txt
│   └── test_myfunc.c
└── unity/
    ├── unity.c
    └── unity.h


project/CMakeLists.txt

cmake_minimum_required(VERSION 3.16)

# Set project name and version
project(my_project VERSION 1.0)

# Add app and test subdirectories
add_subdirectory(app)
add_subdirectory(test)


project/test/CMakeLists.txt

# Add executable target
add_executable(my_test test_myfunc.c)

# Add include directories
target_include_directories(my_test PRIVATE ${PROJECT_SOURCE_DIR}/include)

# Link with Unity and app libraries
target_link_libraries(my_test PRIVATE unity my_app)







댓글 없음:

댓글 쓰기

도커 내부의 hosts에 주소 추가하기

echo "192.168.10.19 happycpu-P620.local" | sudo tee -a /etc/hosts