Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not build tests for make all or make install #365

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Test C++
run: |
cd build
make test
make check

- name: Install Python Bindings
run: python3 -m pip install -e ./build/python[test,pysmt]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Pono was awarded the Oski Award under its original name _cosa2_ at [HWMCC'19](ht
* if building with mathsat, also include `--with-msat` as an option to `configure.sh`
* Run `cd build`.
* Run `make`.
* [optional] Run `make check` to build and run the tests.

### Dependencies

Expand Down
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
Loading