diff options
author | Brad King <brad.king@kitware.com> | 2019-09-17 15:06:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-17 15:07:08 (GMT) |
commit | 35b580d6033395b491c73005d785aa2c456f734e (patch) | |
tree | bf304bbbc98e11cec1e042e0b1453fe42bb008ef | |
parent | 3bc1feae5fe044d796e4bcd932b7228c40fde230 (diff) | |
parent | 0301a76bb464fc3231193c4f1c957327e8258d44 (diff) | |
download | CMake-35b580d6033395b491c73005d785aa2c456f734e.zip CMake-35b580d6033395b491c73005d785aa2c456f734e.tar.gz CMake-35b580d6033395b491c73005d785aa2c456f734e.tar.bz2 |
Merge topic 'remove-failing-modules-test'
0301a76bb4 FindEnvMod: Remove unreliable test case
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3823
-rw-r--r-- | Tests/FindEnvModules/EnvModules.cmake | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Tests/FindEnvModules/EnvModules.cmake b/Tests/FindEnvModules/EnvModules.cmake index 0c81bf2..21b0042 100644 --- a/Tests/FindEnvModules/EnvModules.cmake +++ b/Tests/FindEnvModules/EnvModules.cmake @@ -18,18 +18,16 @@ if(avail_mods) message("module list") env_module_list(loaded_mods) + set(mod0_found FALSE) foreach(mod IN LISTS loaded_mods) message(" ${mod}") + if(NOT mod0_found AND mod MATCHES "^${mod0}") + set(mod0_found ${mod}) + endif() endforeach() - list(LENGTH loaded_mods num_loaded_mods) - message("Number of modules loaded: ${num_loaded_mods}") - if(NOT num_loaded_mods EQUAL 1) - message(FATAL_ERROR "Exactly 1 module should be loaded. Found ${num_loaded_mods}") - endif() - - list(GET loaded_mods 0 mod0_actual) - if(NOT (mod0_actual MATCHES "^${mod0}")) - message(FATAL_ERROR "Loaded module does not match ${mod0}. Actual: ${mod0_actual}") + if(NOT mod0_found) + message(FATAL_ERROR "Requested module ${mod0} not found in loaded modules") endif() + message("module ${mod0} found loaded as ${mod0_found}") endif() |