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)







댓글 없음:

댓글 쓰기

암호화 + base64 하고 쉘스크립트.

 #!/bin/bash # IV와 UserKey를 설정합니다 (아스키 문자열을 그대로 사용). IV="0123456789abcdef"  UserKey="0123456789abcdef" # IV와 UserKey를 16...