-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Pull Request #7535 from trilinos/Trilinos/master_merge_20200616…
…_000613 Automatically Merged using Trilinos Master Merge AutoTester PR Title: Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20200616_000613 branch to master PR Author: trilinos-autotester
- Loading branch information
Showing
59 changed files
with
4,341 additions
and
854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
cmake/std/atdm/test/unit_tests/atdm_config_helper_funcs_unit_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_SCRIPTS_DIR=`echo $BASH_SOURCE | sed "s/\(.*\)\/.*\.sh/\1/g"` | ||
|
||
if [[ "$(uname)" == "Darwin" ]]; then | ||
ATDM_CONFIG_SCRIPT_DIR="../.." | ||
ATDM_UTIL_SCRIPT_ATDM_CONFIG_HELPER_FUNCS="${ATDM_CONFIG_SCRIPT_DIR}/utils/atdm_config_helper_funcs.sh" | ||
SHUNIT2_DIR="${ATDM_CONFIG_SCRIPT_DIR}/../../../commonTools/test/shunit2" | ||
else | ||
ATDM_CONFIG_SCRIPT_DIR=`readlink -f ${CURRENT_SCRIPTS_DIR}/../..` | ||
ATDM_UTIL_SCRIPT_ATDM_CONFIG_HELPER_FUNCS=`readlink -f ${ATDM_CONFIG_SCRIPT_DIR}/utils/atdm_config_helper_funcs.sh` | ||
SHUNIT2_DIR=`readlink -f ${ATDM_CONFIG_SCRIPT_DIR}/../../../commonTools/test/shunit2` | ||
fi | ||
|
||
source ${ATDM_UTIL_SCRIPT_ATDM_CONFIG_HELPER_FUNCS} | ||
# | ||
# Test atdm utility functions | ||
# | ||
|
||
test_atdm_remove_substrings_from_env_var() { | ||
for DELIM in ":" "," "-" "_"; do | ||
# Don't remove anything from path | ||
EXPECTED_ENV_VAR="/paths" | ||
ENV_VAR="$EXPECTED_ENV_VAR" | ||
STRINGS="/test/path1" | ||
atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS" | ||
${_ASSERT_EQUALS_} ${EXPECTED_ENV_VAR} ${ENV_VAR} | ||
|
||
# Remove dir from end of path | ||
EXPECTED_ENV_VAR="/paths" | ||
ENV_VAR="$EXPECTED_ENV_VAR$DELIM/test/path1" | ||
STRINGS="/test/path1" | ||
atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS" | ||
${_ASSERT_EQUALS_} ${EXPECTED_ENV_VAR} ${ENV_VAR} | ||
|
||
# Remove dir at beginning of path | ||
EXPECTED_ENV_VAR="/paths" | ||
ENV_VAR="/test/path1$DELIM$EXPECTED_ENV_VAR" | ||
STRINGS="/test/path1" | ||
atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS" | ||
${_ASSERT_EQUALS_} ${EXPECTED_ENV_VAR} ${ENV_VAR} | ||
|
||
# Remove dir at beginning of path with similar path beside it | ||
EXPECTED_ENV_VAR="/paths$DELIM/paths2" | ||
ENV_VAR="/test/path1$DELIM$EXPECTED_ENV_VAR" | ||
STRINGS="/test/path1" | ||
atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS" | ||
${_ASSERT_EQUALS_} ${EXPECTED_ENV_VAR} ${ENV_VAR} | ||
|
||
# Remove dirs at beginning and end of path | ||
EXPECTED_ENV_VAR="/paths" | ||
ENV_VAR="/test/path1$DELIM$EXPECTED_ENV_VAR$DELIM/test/path2" | ||
STRINGS="/test/path1 /test/path2" | ||
atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS" | ||
${_ASSERT_EQUALS_} ${EXPECTED_ENV_VAR} ${ENV_VAR} | ||
|
||
# Only one dir matches to be removed (other non-matching dir is ignored) | ||
EXPECTED_ENV_VAR="/paths" | ||
ENV_VAR="/test/path2$DELIM/test/path1$DELIM$EXPECTED_ENV_VAR" | ||
STRINGS="/test/path1 /test/path2" | ||
atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS" | ||
${_ASSERT_EQUALS_} ${EXPECTED_ENV_VAR} ${ENV_VAR} | ||
done | ||
|
||
for DELIM in ";" "." "/" " "; do | ||
RET=$(atdm_remove_substrings_from_env_var ENV_VAR "$DELIM" "$STRINGS") | ||
assertEquals "ERROR: atdm_remove_substrings_from_env_var: \"$DELIM\" is an invalid delimiter." "$RET" | ||
done | ||
} | ||
|
||
# | ||
# Run the unit tests | ||
# | ||
. ${SHUNIT2_DIR}/shunit2 |
70 changes: 70 additions & 0 deletions
70
cmake/std/atdm/test/unit_tests/get_known_system_info_unit_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_SCRIPTS_DIR=`echo $BASH_SOURCE | sed "s/\(.*\)\/.*\.sh/\1/g"` | ||
|
||
if [[ "$(uname)" == "Darwin" ]]; then | ||
ATDM_CONFIG_SCRIPT_DIR="../.." | ||
ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO="${ATDM_CONFIG_SCRIPT_DIR}/utils/get_known_system_info.sh" | ||
SHUNIT2_DIR="${ATDM_CONFIG_SCRIPT_DIR}/../../../commonTools/test/shunit2" | ||
else | ||
ATDM_CONFIG_SCRIPT_DIR=`readlink -f ${CURRENT_SCRIPTS_DIR}/../..` | ||
ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO=`readlink -f ${ATDM_CONFIG_SCRIPT_DIR}/utils/get_known_system_info.sh` | ||
SHUNIT2_DIR=`readlink -f ${ATDM_CONFIG_SCRIPT_DIR}/../../../commonTools/test/shunit2` | ||
fi | ||
|
||
# | ||
# Test atdm get_known_system_info script | ||
# | ||
test_atdm_get_known_system_info() { | ||
# TODO: D.2 needs to be tested by setting these values: | ||
SNLSYSTEM= | ||
SEMS_PLATFORM= | ||
ATDM_SYSTEM_NAME= | ||
SNLCLUSTER= | ||
|
||
# Get the good ATDM_KNOWN_SYSTEM_NAMES_LIST | ||
ATDM_CONFIG_BUILD_NAME=unit_test | ||
ATDM_CONFIG_DISABLE_WARNINGS=ON | ||
source ${ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO} | ||
|
||
# Check that all known system names pass | ||
for ATDM_CONFIG_BUILD_NAME in ${ATDM_KNOWN_SYSTEM_NAMES_LIST[@]}; do | ||
ATDM_CONFIG_GET_KNOW_SYSTEM_INFO_REAL_HOSTNAME_OVERRIDE_FOR_UNIT_TESTING=$ATDM_CONFIG_BUILD_NAME | ||
RET=$(source ${ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO}) | ||
assertEquals "Hostname '$ATDM_CONFIG_BUILD_NAME' matches known ATDM host '$ATDM_CONFIG_BUILD_NAME' and system '$ATDM_CONFIG_BUILD_NAME'" "$RET" | ||
done | ||
|
||
# Set the bad ATDM_KNOWN_SYSTEM_NAMES | ||
ATDM_KNOWN_SYSTEM_NAMES_LIST=( | ||
dne-name1 | ||
dne-name2 | ||
dne-name3 | ||
) | ||
|
||
# Check a few bad systems names for failure | ||
for ATDM_CONFIG_BUILD_NAME in ${ATDM_KNOWN_SYSTEM_NAMES_LIST[@]}; do | ||
ATDM_CONFIG_GET_KNOW_SYSTEM_INFO_REAL_HOSTNAME_OVERRIDE_FOR_UNIT_TESTING=$ATDM_CONFIG_BUILD_NAME | ||
source ${ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO} | ||
assertEquals "" "$ATDM_SYSTEM_NAME" | ||
assertEquals "$ATDM_CONFIG_BUILD_NAME" "$realHostname" | ||
done | ||
|
||
# Ensure that cts1empire is the default on cts1 | ||
ATDM_CONFIG_BUILD_NAME=default | ||
ATDM_CONFIG_GET_KNOW_SYSTEM_INFO_REAL_HOSTNAME_OVERRIDE_FOR_UNIT_TESTING=$ATDM_CONFIG_BUILD_NAME | ||
SNLSYSTEM=cts1 | ||
RET=$(source ${ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO}) | ||
assertEquals "Hostname '$ATDM_CONFIG_BUILD_NAME' matches known ATDM host '$ATDM_CONFIG_BUILD_NAME' and system 'cts1empire'" "$RET" | ||
|
||
# Ensure that cts1 is still selected when it's in the build name | ||
ATDM_CONFIG_BUILD_NAME=cts1-default | ||
ATDM_CONFIG_GET_KNOW_SYSTEM_INFO_REAL_HOSTNAME_OVERRIDE_FOR_UNIT_TESTING=$ATDM_CONFIG_BUILD_NAME | ||
SNLSYSTEM=cts1 | ||
RET=$(source ${ATDM_UTIL_SCRIPT_GET_KNOWN_SYSTEM_INFO}) | ||
assertEquals "Hostname '$ATDM_CONFIG_BUILD_NAME' matches known ATDM host '$ATDM_CONFIG_BUILD_NAME' and system 'cts1'" "$RET" | ||
} | ||
|
||
# | ||
# Run the unit tests | ||
# | ||
. ${SHUNIT2_DIR}/shunit2 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.