mirror of
https://github.com/meekrosoft/fff
synced 2026-01-23 08:25:59 +01:00
Replace makefiles with CMakeLists.txt. This will allow for IDE and platform agnostic builds of FFF. Update the CI for FFF to use github workflows which don't depend on MS VC. The workflow added will verify the pull requests sent to master buy running 'buildandtest' which mirrors the developer workflow. Signed-off-by: Yuval Peress <peress@google.com>
56 lines
1.2 KiB
CMake
56 lines
1.2 KiB
CMake
# Copyright 2022 Google LLC
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Create a list of common files needed for tests
|
|
set(
|
|
COMMON_FILE_LIST
|
|
c_test_framework.h
|
|
test_cases.include
|
|
)
|
|
|
|
# Create the C test executable
|
|
add_executable(c_test fff_test_c.c ${COMMON_FILE_LIST})
|
|
target_link_libraries(c_test PRIVATE fff)
|
|
|
|
# Create the C++ test executable
|
|
add_executable(cpp_test fff_test_cpp.cpp ${COMMON_FILE_LIST})
|
|
target_link_libraries(cpp_test PRIVATE gtest fff)
|
|
|
|
# Create the C global test executable
|
|
add_executable(c_global_test
|
|
fff_test_global_c.c
|
|
global_fakes.c
|
|
global_fakes.h
|
|
${COMMON_FILE_LIST}
|
|
)
|
|
target_link_libraries(c_global_test PRIVATE fff)
|
|
|
|
# Create the C++ global test executable
|
|
add_executable(cpp_global_test
|
|
fff_test_global_cpp.cpp
|
|
global_fakes.c
|
|
global_fakes.h
|
|
${COMMON_FILE_LIST}
|
|
)
|
|
target_link_libraries(cpp_global_test PRIVATE gtest fff)
|
|
|
|
# Add the tests for ctest
|
|
add_test(
|
|
NAME c_test
|
|
COMMAND $<TARGET_FILE:c_test>
|
|
)
|
|
|
|
add_test(
|
|
NAME cpp_test
|
|
COMMAND $<TARGET_FILE:cpp_test>
|
|
)
|
|
|
|
add_test(
|
|
NAME c_global_test
|
|
COMMAND $<TARGET_FILE:c_global_test>
|
|
)
|
|
|
|
add_test(
|
|
NAME cpp_global_test
|
|
COMMAND $<TARGET_FILE:cpp_global_test>
|
|
) |