Previously, on CI, unit tests and api tests were run twice since we use
a ctest exclude rule based on labels (-LE) which includes unit and api
tests, but then run them separately again. This cleans up the CI test
configuration.
Further, unit gtest unit tests were added with gtest_add_tests, which
adds every test of a unit test binary as a single test target to ctest.
In theory, this may speed up testing (because more parallelism) but in
practice it slows it down due to the start up overhead. It also clutters
CI output. This cleans up the gtest configuration to add the gtest unit
tests per test binary rather then per test of a test binary.
default: true
check-python-bindings:
default: false
- check-unit-tests:
- default: true
regressions-args:
default: ""
regressions-exclude:
RUN_REGRESSION_ARGS: ${{ inputs.regressions-args }}
working-directory: ${{ inputs.build-dir }}
- - name: Run Unit Tests
- shell: bash
- run: |
- if [[ "${{ inputs.check-unit-tests }}" != "true" ]]; then exit 0; fi
- make -j${{ env.num_proc }} apitests units
- working-directory: ${{ inputs.build-dir }}
-
- name: Install Check
shell: bash
run: |
os: ubuntu-18.04
config: production --auto-download --assertions --tracing --unit-testing --java-bindings --editline
cache-key: dbg
- check-units: true
exclude_regress: 3-4
run_regression_args: --tester base --tester model --tester synth --tester abduct --tester proof
build-dir: ${{ steps.configure-and-build.outputs.shared-build-dir }}
check-examples: ${{ matrix.check-examples }}
check-python-bindings: ${{ matrix.python-bindings }}
- check-unit-tests: ${{ matrix.check-units }}
regressions-args: ${{ matrix.run_regression_args }}
regressions-exclude: ${{ matrix.exclude_regress }}
check-examples: false
check-install: false
check-python-bindings: false
- check-unit-tests: ${{ matrix.check-units }}
regressions-args: ${{ matrix.run_regression_args }}
regressions-exclude: 1-4
##
find_package(GTest REQUIRED)
-include(GoogleTest)
include_directories(.)
include_directories(${PROJECT_SOURCE_DIR}/src)
set(test_src ${CMAKE_CURRENT_LIST_DIR}/${name}.cpp)
add_executable(${name} ${test_src})
target_compile_definitions(${name} PRIVATE ${CVC5_UNIT_TEST_FLAGS_BLACK})
- gtest_add_tests(TARGET ${name})
target_link_libraries(${name} PUBLIC main-test GMP)
target_link_libraries(${name} PUBLIC GTest::Main)
target_link_libraries(${name} PUBLIC GTest::GTest)