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)







댓글 없음:

댓글 쓰기

[siwg917] 공유기 mac 얻기, arp table에서 확인.

1. arp 요청함수. #include "lwip/netif.h" #include "lwip/ip4_addr.h" #include "lwip/etharp.h" #define ARP_RETRY...