From 0edef61d656de4e6ffac37ae4db57f205b8a16a8 Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Tue, 11 Mar 2025 06:30:45 +0100 Subject: [PATCH] ts: test via output on whatis/search subcmds Signed-off-by: Xavier Delaruelle --- testsuite/modulefiles.spider1/moda/1 | 1 + testsuite/modulefiles.spider2/modb/1 | 1 + .../modules.70-maint/360-avail_output.exp | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/testsuite/modulefiles.spider1/moda/1 b/testsuite/modulefiles.spider1/moda/1 index d50da500..3ca2a02a 100644 --- a/testsuite/modulefiles.spider1/moda/1 +++ b/testsuite/modulefiles.spider1/moda/1 @@ -1,5 +1,6 @@ #%Module if {[info exists env(TESTSUITE_SPIDER_MODPATH1)]} { + module-whatis {module description} switch -- $env(TESTSUITE_SPIDER_MODPATH1) { use_modpath2 { module use $env(TESTSUITEDIR)/modulefiles.spider2 diff --git a/testsuite/modulefiles.spider2/modb/1 b/testsuite/modulefiles.spider2/modb/1 index bf02445e..94de40cd 100644 --- a/testsuite/modulefiles.spider2/modb/1 +++ b/testsuite/modulefiles.spider2/modb/1 @@ -1,5 +1,6 @@ #%Module if {[info exists env(TESTSUITE_SPIDER_MODPATH2)]} { + module-whatis {module description} switch -- $env(TESTSUITE_SPIDER_MODPATH2) { use_modpath3 { module use ../../modulefiles.spider3 diff --git a/testsuite/modules.70-maint/360-avail_output.exp b/testsuite/modules.70-maint/360-avail_output.exp index 7fcf09ef..0b6def9d 100644 --- a/testsuite/modules.70-maint/360-avail_output.exp +++ b/testsuite/modules.70-maint/360-avail_output.exp @@ -457,6 +457,24 @@ modb/1 modb/2 $modlin $modpathre.spider1 $modlin moda/1 moda/2 " +# whatis/search report (no effect) +testouterr_cmd_re sh {whatis modb} OK "$modlin $modpathre.spider2 $modlin +\\s+modb/1: module description" +testouterr_cmd_re sh {search description} OK "$modlin $modpathre.spider2 $modlin +\\s+modb/1: module description + +$modlin $modpathre.spider1 $modlin +\\s+moda/1: module description" +setenv_var TESTSUITE_VIA modulepath_label1 +testouterr_cmd_re sh {whatis modb} OK "$modlin My label spider2 $modlin +\\s+modb/1: module description" +testouterr_cmd_re sh {search description} OK "$modlin My label spider2 $modlin +\\s+modb/1: module description + +$modlin My label spider1 $modlin +\\s+moda/1: module description" +unsetenv_var TESTSUITE_VIA + # no modulepath reported but via set setenv_loaded_module [list moda/1] [list $modpath.spider1/moda/1] setenv_var __MODULES_LMUSE moda/1&$modpath.spider2