From 034e18ae2f576719d3804d6ad201f508495d69c1 Mon Sep 17 00:00:00 2001 From: Evan Harvey Date: Thu, 18 Jun 2020 13:49:14 -0600 Subject: [PATCH 1/2] ATDM/cts1empire: Fix custom_builds and add unit tests --- cmake/std/atdm/CMakeLists.txt | 1 + cmake/std/atdm/cts1empire/custom_builds.sh | 11 ++-- .../cts1empire/custom_builds_unit_tests.sh | 55 +++++++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100755 cmake/std/atdm/cts1empire/custom_builds_unit_tests.sh diff --git a/cmake/std/atdm/CMakeLists.txt b/cmake/std/atdm/CMakeLists.txt index fb13f84118bb..836684aec829 100644 --- a/cmake/std/atdm/CMakeLists.txt +++ b/cmake/std/atdm/CMakeLists.txt @@ -5,4 +5,5 @@ TRIBITS_ADD_TEST_DIRECTORIES(van1-tx2) TRIBITS_ADD_TEST_DIRECTORIES(ats1) TRIBITS_ADD_TEST_DIRECTORIES(ats2) TRIBITS_ADD_TEST_DIRECTORIES(cts1) +TRIBITS_ADD_TEST_DIRECTORIES(cts1empire) TRIBITS_PACKAGE_POSTPROCESS() diff --git a/cmake/std/atdm/cts1empire/custom_builds.sh b/cmake/std/atdm/cts1empire/custom_builds.sh index 78de4dc8f1d4..bc492f2817d6 100644 --- a/cmake/std/atdm/cts1empire/custom_builds.sh +++ b/cmake/std/atdm/cts1empire/custom_builds.sh @@ -7,11 +7,12 @@ # Custom compiler selection logic -if [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18.0.2-openmpi-4.0.1"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18.0.2_openmpi-4.0.1"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel" ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"default" ]] \ +if atdm_match_any_buildname_keyword \ + intel-18.0.2-openmpi-4.0.1 \ + intel-18.0.2_openmpi-4.0.1 \ + intel-18.0.2 \ + intel \ + default \ ; then export ATDM_CONFIG_COMPILER=INTEL-18.0.2_OPENMPI-4.0.1 else diff --git a/cmake/std/atdm/cts1empire/custom_builds_unit_tests.sh b/cmake/std/atdm/cts1empire/custom_builds_unit_tests.sh new file mode 100755 index 000000000000..70912a119902 --- /dev/null +++ b/cmake/std/atdm/cts1empire/custom_builds_unit_tests.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +if [[ "$(uname)" == "Darwin" ]]; then + ATDM_CONFIG_SCRIPT_DIR=".." + source "${ATDM_CONFIG_SCRIPT_DIR}/utils/define_atdm_match_keyword.sh" + SHUNIT2_DIR="${ATDM_CONFIG_SCRIPT_DIR}/../../../commonTools/test/shunit2" +else + CURRENT_SCRIPTS_DIR=`echo $BASH_SOURCE | sed "s/\(.*\)\/.*\.sh/\1/g"` + ATDM_CONFIG_SCRIPT_DIR=`readlink -f ${CURRENT_SCRIPTS_DIR}/..` + SHUNIT2_DIR=`readlink -f ${ATDM_CONFIG_SCRIPT_DIR}/../../../commonTools/test/shunit2` +fi + +# +# Test compiler parsing +# + +testAll() { + + ATDM_CONFIG_SYSTEM_DIR=${ATDM_CONFIG_SCRIPT_DIR}/cts1empire + + ATDM_CONFIG_BUILD_NAME=before-intel-18.0.2-openmpi-4.0.1_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} INTEL-18.0.2_OPENMPI-4.0.1 ${ATDM_CONFIG_COMPILER} + + ATDM_CONFIG_BUILD_NAME=before-intel-18.0.2_openmpi-4.0.1-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} INTEL-18.0.2_OPENMPI-4.0.1 ${ATDM_CONFIG_COMPILER} + + ATDM_CONFIG_BUILD_NAME=before_intel-18.0.2-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} INTEL-18.0.2_OPENMPI-4.0.1 ${ATDM_CONFIG_COMPILER} + + ATDM_CONFIG_BUILD_NAME=default + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} INTEL-18.0.2_OPENMPI-4.0.1 ${ATDM_CONFIG_COMPILER} + + ATDM_CONFIG_BUILD_NAME=before-intel-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} INTEL-18.0.2_OPENMPI-4.0.1 ${ATDM_CONFIG_COMPILER} + + ATDM_CONFIG_BUILD_NAME=BEFORE-INTEL-AFTER + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} INTEL-18.0.2_OPENMPI-4.0.1 ${ATDM_CONFIG_COMPILER} + + ATDM_CONFIG_BUILD_NAME=anything-intell + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} DEFAULT ${ATDM_CONFIG_COMPILER} + +} + + +# +# Run the unit tests +# +. ${SHUNIT2_DIR}/shunit2 From ba23880a97c96aaee652663baed77fbeaf6a6328 Mon Sep 17 00:00:00 2001 From: Evan Harvey Date: Thu, 18 Jun 2020 15:21:18 -0600 Subject: [PATCH 2/2] ATDM/cts1empire: Add CMakeLists.txt and print build name on error --- cmake/std/atdm/cts1empire/CMakeLists.txt | 11 +++++++++++ cmake/std/atdm/cts1empire/custom_builds.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 cmake/std/atdm/cts1empire/CMakeLists.txt diff --git a/cmake/std/atdm/cts1empire/CMakeLists.txt b/cmake/std/atdm/cts1empire/CMakeLists.txt new file mode 100644 index 000000000000..50539c5ad7a9 --- /dev/null +++ b/cmake/std/atdm/cts1empire/CMakeLists.txt @@ -0,0 +1,11 @@ +TRIBITS_ADD_ADVANCED_TEST( cts1empire_custom_builds_unit_tests + OVERALL_WORKING_DIRECTORY TEST_NAME + OVERALL_NUM_MPI_PROCS 1 + TEST_0 CMND env + ARGS SHUNIT_COLOR=none ${CMAKE_CURRENT_SOURCE_DIR}/custom_builds_unit_tests.sh + PASS_REGULAR_EXPRESSION_ALL + "ERROR: A supported compiler was not selected for 'cts1empire' env - anything-intell" + "Ran 1 test" + "[^]OK[$]" + ALWAYS_FAIL_ON_NONZERO_RETURN + ) diff --git a/cmake/std/atdm/cts1empire/custom_builds.sh b/cmake/std/atdm/cts1empire/custom_builds.sh index bc492f2817d6..a6a851fa5249 100644 --- a/cmake/std/atdm/cts1empire/custom_builds.sh +++ b/cmake/std/atdm/cts1empire/custom_builds.sh @@ -18,7 +18,7 @@ if atdm_match_any_buildname_keyword \ else echo echo "***" - echo "*** ERROR: A supported compiler was not selected for 'cts1empire' env" + echo "*** ERROR: A supported compiler was not selected for 'cts1empire' env - $ATDM_CONFIG_BUILD_NAME" echo "***" echo "*** Supported compilers include:" echo "***"