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)







댓글 없음:

댓글 쓰기

gitea 설치

깃 서버 wget -O gitea https://dl.gitea.com/gitea/1.22.0/gitea-1.22.0-linux-amd64 chmod a+x gitea ./gitea web github 에서 미러링시에, access token을 넣어야...