From c6f72912efcddc6f56d860643d596bf39f4f389f Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sun, 10 Nov 2024 18:40:03 +0100 Subject: [PATCH] ts: improve coverage of getModulefileFromLoadingModule proc --- testsuite/example/siteconfig.tcl-1 | 5 +++++ testsuite/modules.00-init/120-siteconfig.exp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/testsuite/example/siteconfig.tcl-1 b/testsuite/example/siteconfig.tcl-1 index 77e41698a..dbcb5e6d8 100644 --- a/testsuite/example/siteconfig.tcl-1 +++ b/testsuite/example/siteconfig.tcl-1 @@ -666,5 +666,10 @@ if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETLOADEDPREREQPATH)]} { report [string length [getLoadedPrereqPath foo qux]] } +# specific tests to improve getModulefileFromLoadingModule coverage +if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETMODULEFILEFROMLOADINGMODULE)]} { + report [string length [getModulefileFromLoadingModule foo]] +} + } diff --git a/testsuite/modules.00-init/120-siteconfig.exp b/testsuite/modules.00-init/120-siteconfig.exp index 6c5213514..3a0ec41bc 100644 --- a/testsuite/modules.00-init/120-siteconfig.exp +++ b/testsuite/modules.00-init/120-siteconfig.exp @@ -734,6 +734,13 @@ lappend ans $vers_reportre testouterr_cmd_re sh -V OK [join $ans \n] unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETLOADEDPREREQPATH +setenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFILEFROMLOADINGMODULE 1 +set ans [list] +lappend ans 0 +lappend ans $vers_reportre +testouterr_cmd_re sh -V OK [join $ans \n] +unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFILEFROMLOADINGMODULE + } elseif {$verbose} { send_user "\tSkip tests relying on an excepted siteconfig file installed\n"