Skip to content

Commit

Permalink
Do not build tests for make all or make install
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanoKobalamyne committed Jan 24, 2025
1 parent 6e09065 commit 1619d4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,22 @@ if (WITH_MSAT)
add_definitions(-DWITH_MSAT)
endif()

add_library(pono-test-lib "${PONO_LIB_TYPE}"
add_library(pono-test-lib EXCLUDE_FROM_ALL "${PONO_LIB_TYPE}"
"${CMAKE_CURRENT_SOURCE_DIR}/common_ts.cpp"
)

# INCLUDE_DIRS set in top-level CMakeLists.txt
target_include_directories(pono-test-lib PUBLIC "${INCLUDE_DIRS}")
target_link_libraries(pono-test-lib pono-lib)

# Create `make check` target that (re-)builds tests before trying to run them.
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})

macro(pono_add_test name)
add_executable(${name} "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp")
add_executable(${name} EXCLUDE_FROM_ALL "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp")
target_link_libraries(${name} gtest gtest_main)
target_link_libraries(${name} pono-test-lib) # also includes pono-lib because it's linked
add_dependencies(check ${name})
add_test(NAME ${name} COMMAND ${name})
endmacro()

Expand Down

0 comments on commit 1619d4a

Please sign in to comment.