Skip to content

Commit

Permalink
cmake: update status info; fix ngen_add_tests depends; set bmi_c ON f…
Browse files Browse the repository at this point in the history
…or PET github actions
  • Loading branch information
program-- committed Dec 28, 2023
1 parent 6b72c93 commit f31ffb2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_and_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
uses: ./.github/actions/ngen-build
with:
targets: "compare_pet"
bmi_c: on
build-cores: ${{ env.LINUX_NUM_PROC_CORES }}

- name: Run Tests
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ deprecated_option(OLD NETCDF_ACTIVE NEW NGEN_WITH_NETCDF)
deprecated_option(OLD BMI_C_LIB_ACTIVE NEW NGEN_WITH_BMI_C)
deprecated_option(OLD BMI_FORTRAN_ACTIVE NEW NGEN_WITH_BMI_FORTRAN)
deprecated_option(OLD QUIET NEW NGEN_QUIET)
deprecated_option(OLD PACKAGE_TESTS NEW NGEN_WITH_TESTS)

# -- Removed
# deprecated_option(OLD PACKAGE_TESTS NEW NGEN_WITH_TESTS)

# Options to automate building of extern-distributed models
option(NGEN_WITH_EXTERN_CXX_MODELS "Build with extern-distributed C++ models" ON)
Expand Down Expand Up @@ -364,6 +366,10 @@ ngen_multiline_message(
" NGEN_WITH_PYTHON: ${NGEN_WITH_PYTHON}"
" NGEN_WITH_ROUTING: ${NGEN_WITH_ROUTING}"
" NGEN_WITH_TESTS: ${NGEN_WITH_TESTS}"
" NGEN_WITH_COVERAGE: ${NGEN_WITH_COVERAGE}"
" NGEN_WITH_EXTERN_CXX_MODELS: ${NGEN_WITH_EXTERN_CXX_MODELS}"
" NGEN_WITH_EXTERN_C_MODELS: ${NGEN_WITH_EXTERN_C_MODELS}"
" NGEN_WITH_EXTERN_FORTRAN_MODELS: ${NGEN_WITH_EXTERN_FORTRAN_MODELS}"
" NGEN_QUIET: ${NGEN_QUIET}"
"Environment summary:"
" Boost:"
Expand Down
11 changes: 7 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ function(ngen_add_test TESTNAME)
target_link_libraries(${TESTNAME} PRIVATE gtest gtest_main ${NGEN_TEST_LIBRARIES})
set_target_properties(${TESTNAME} PROPERTIES FOLDER test)

if(NGEN_TEST_DEPENDS)
add_dependencies(${TESTNAME} ${NGEN_TEST_DEPENDS})
endif()
# Iterate over each dependency, and add as a dependency for the test
# IF the dependency is a target.
foreach(dependency IN LISTS NGEN_TEST_DEPENDS)
if(TARGET ${dependency})
add_dependencies(${TESTNAME} ${NGEN_TEST_DEPENDS})
endif()
endforeach()

gtest_discover_tests(
${TESTNAME}
Expand Down Expand Up @@ -159,7 +163,6 @@ ngen_add_test(
NGen::core_mediator
NGen::forcing
NGen::ngen_bmi
testbmicppmodel
DEPENDS
testbmicppmodel
)
Expand Down

0 comments on commit f31ffb2

Please sign in to comment.