Commit 80c0e125 authored by Kochunas, Brendan M.'s avatar Kochunas, Brendan M. Committed by Henderson, Shane
Browse files

Adds logic for enable/disable testGenReq

Squash branch 'hotfix_genReqTables_pandas_only' into 'master'

* Adds logic for enable/disable testGenReq

Description:
testGenReq has a dependency on the pandas python package.
This test was also always enabled. If the dev environment did not
have pandas the test would still be enabled and fail.

This commit adds logic to the build system to check if the pandas
python package is available in the python environment and then
enables/disables testGenReq accordingly.

VERA-dev Issue # - 5690

See commit message on branch

<!-- Include a link to VERA development issues if appropriate, or delete this line -->

**Developer Checklist:**
- [x] Have you done a self-review after creating the merge request?
- [x] Have you filled in the Merge Request information (title, description) thoroughly?
- [x] Have you updated the relevant tickets (if this MR is linked to any VERA-dev tickets)?
- [x] Have you addressed all suggested feedback and commented on it to let the reviewer know? (Do not resolve discussions that the reviewer started)

**Reviewer Checklist:**
- [x] Have you confirmed all discussions were adequately addressed and resolved them all?
- [x] Does it conform to formatting guidelines? Yes
- [x] Are there adequate and clear comments? Yes
- [x] Is the design clean and sensible? Yes
- [x] Are the changes optimal/efficient? Yes
- [x] Were sufficient DBC checks added? N/A
- [x] Are there unit tests? (if necessary) Yes
- [x] Is the MR description clear, including a link to the VERA-Dev issue if appropriate?

**PSM Checklist**
- [x] Have you confirmed that all discussions were addressed, or that follow-on issues have been created for them?
- [x] Have you confirmed sufficient testing was conducted?
- [x] Does this impact other repositories? No
- [x] Does the MR have an adequate description?
- [x] If the MR has multiple commits, did you set the MR to squash merge? Single commit

See merge request https://code.ornl.gov/futility/Futility/-/merge_requests/413
parent 8f6c02e3
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
#                          Futility Development Group                          !
#                             All rights reserved.                             !
#                                                                              !
# Futility is a jointly-maintained, open-source project between the University !
# of Michigan and Oak Ridge National Laboratory.  The copyright and license    !
# can be found in LICENSE.txt in the head directory of this repository.        !
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!

FUNCTION(CHECK_PYTHON_PANDAS)
    MESSAGE(STATUS "Checking for python package: pandas...")
    EXECUTE_PROCESS(
        COMMAND "${PYTHON_EXECUTABLE}" -c "import pandas"
        RESULT_VARIABLE PANDAS_RESULT
        OUTPUT_QUIET
        ERROR_QUIET
    )

    IF(PANDAS_RESULT EQUAL 0)
        MESSAGE(STATUS "Checking for python package: pandas... FOUND")
        GLOBAL_SET(PYTHON_HAS_PANDAS TRUE)
    ELSE()
        MESSAGE(STATUS "Checking for python package: pandas... NOT-FOUND")
        GLOBAL_SET(PYTHON_HAS_PANDAS FALSE)
    ENDIF()

    
ENDFUNCTION()
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -7,6 +7,10 @@
# can be found in LICENSE.txt in the head directory of this repository.        !
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
INCLUDE(${Futility_SOURCE_DIR}/cmake/CheckMPIF2008StandardCompiles.cmake)
INCLUDE(${Futility_SOURCE_DIR}/cmake/CheckPythonPandas.cmake)

CHECK_PYTHON_PANDAS()

IF(${PROJECT_NAME}_VERBOSE_CONFIGURE)
    MESSAGE("Configuring Futility compiler options for:")
    PRINT_VAR(PACKAGE_NAME)
@@ -17,6 +21,7 @@ IF(${PROJECT_NAME}_VERBOSE_CONFIGURE)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_PETSC)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_SLEPC)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_HDF5)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_PNG)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_MKL)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_PARDISO)
    PRINT_VAR(${PACKAGE_NAME}_ENABLE_BLAS)
+8 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ SET(UNIT_TEST_NAMES
    testBLAS
    testStrings
    testTimes
    testGenReqTables
    testGeom_Points
    testGeom_Line
    testGeom_Plane
@@ -119,6 +118,14 @@ IF(${PACKAGE_NAME}_ENABLE_HDF5)
        )
ENDIF()

# add test if Python has pandas
IF(PYTHON_HAS_PANDAS)
    SET(UNIT_TEST_NAMES
        ${UNIT_TEST_NAMES}
        testGenReqTables
        )
ENDIF()

FOREACH(test ${UNIT_TEST_NAMES})
    ADD_SUBDIRECTORY(${test})
ENDFOREACH()