mirror of
https://github.com/meekrosoft/fff
synced 2026-01-23 00:15:59 +01:00
* Add missing GTest linking * Add unit testing switch * Rename UNIT_TESTING to be fff-specific * Add fff.h generation toggle * Use options instead of variables for disabling build elements * Add interface library for when the header is not regenerated * Update build script and README
32 lines
875 B
CMake
32 lines
875 B
CMake
# Copyright 2022 Google LLC
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Create the driver test binary
|
|
add_executable(driver_test
|
|
src/driver.c
|
|
src/driver.test.cpp
|
|
)
|
|
target_include_directories(driver_test PRIVATE include)
|
|
target_link_libraries(driver_test PRIVATE GTest::gtest_main fff)
|
|
target_compile_definitions(driver_test PUBLIC TEST_USER_OWN_TR1_TUPLE=1 TESTING)
|
|
|
|
# Create the driver fff test binary
|
|
add_executable(driver_fff_test
|
|
src/driver.c
|
|
src/driver.test.fff.cpp
|
|
)
|
|
target_include_directories(driver_fff_test PRIVATE include)
|
|
target_link_libraries(driver_fff_test PRIVATE GTest::gtest_main fff)
|
|
target_compile_definitions(driver_fff_test PUBLIC TEST_USER_OWN_TR1_TUPLE=1 TESTING)
|
|
|
|
# Add tests to ctest
|
|
add_test(
|
|
NAME driver_test
|
|
COMMAND $<TARGET_FILE:driver_test>
|
|
)
|
|
|
|
add_test(
|
|
NAME driver_fff_test
|
|
COMMAND $<TARGET_FILE:driver_fff_test>
|
|
)
|