"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "script/mt" between
modules-5.1.1.tar.bz2 and modules-5.2.0.tar.bz2

About: The Environment Modules package provides for the dynamic modification of a user’s environment via modulefiles.

mt  (modules-5.1.1.tar.bz2):mt  (modules-5.2.0.tar.bz2)
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# MT, run specific part of the test suite # MT, run all or specific parts of the test suite
# Copyright (C) 2018-2021 Xavier Delaruelle # Copyright (C) 2018-2022 Xavier Delaruelle
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or # the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
########################################################################## ##########################################################################
set -u set -u
# print help message
echo_usage() {
echo "Usage: $0 [options] [testsuite] [serienum[/testfilenum]]...
Run all or specific parts of the test suite
Test suites:
modules Test modulecmd.tcl built script (default)
quick Short version of modulecmd.tcl testsuite
cov Coverage mode of modulecmd.tcl testsuite
install Test Modules installation
lint Lint script files of this repository
Select parts of testsuite:
serienum Identification number of testsuite directory containing a
series of testfile (e.g., '50' for modules.50-cmds dir.)
testfilenum Identification number of testfile in a testserie (e.g.,
'370' for 370-variant.exp testfile in modules.70-maint dir.)
Options:
-h, --help Show this help message and exit
Examples:
$0
$0 quick
$0 lint
$0 50/37 61 70/{290,440}
"
}
# print message on stderr then exit # print message on stderr then exit
echo_error() { echo_error() {
echo -e "ERROR: $1" >&2 echo -e "ERROR: $1" >&2
exit 1 exit 1
} }
if [ ! -e tcl/main.tcl.in ]; then if [ ! -e tcl/main.tcl.in ]; then
echo_error "Not in correct directory" echo_error "Not in correct directory"
fi fi
skipping to change at line 46 skipping to change at line 76
make=gmake make=gmake
else else
make=make make=make
fi fi
# make target # make target
target=test target=test
testserie=modules testserie=modules
setuptestfiles=(00/005 00/006 00/010 00/050 00/080 00/085) setuptestfiles=(00/005 00/006 00/010 00/050 00/080 00/085)
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [ "$1" = "quick" ]; then if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo_usage
exit 0
elif [ "$1" = "modules" ]; then
target=test
testserie=modules
shift
elif [ "$1" = "quick" ]; then
export QUICKTEST=1 export QUICKTEST=1
shift shift
elif [ "$1" = "cov" ]; then elif [ "$1" = "cov" ]; then
export COVERAGE=y export COVERAGE=y
shift shift
elif [ "$1" = "install" ]; then elif [ "$1" = "install" ]; then
target=testinstall target=testinstall
testserie=install testserie=install
setuptestfiles=(00/005 00/006 00/010 00/011) setuptestfiles=(00/005 00/006 00/010 00/011)
shift shift
elif [ "$1" = "lint" ]; then
target=testlint
testserie=lint
setuptestfiles=(00/005 00/006 00/011)
shift
fi fi
fi fi
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
# build list of test files to run test on # build list of test files to run test on
declare -a testfiles declare -a testfiles
for i in ${setuptestfiles[@]} ${@}; do for i in "${setuptestfiles[@]}" "${@}"; do
j=${i##*/} j=${i##*/}
i=${i%/*} i=${i%/*}
# add all test files if passed a full section number or a test file # add all test files if passed a full section number or a test file
# from collection section (this section must be run entirely) # from collection section (this section must be run entirely)
if [ "$j" == "$i" ] || [ "$i" == "61" ]; then if [ "$j" == "$i" ] || [ "$i" == "61" ]; then
testfiles+=(testsuite/$testserie.${i}*/*.exp) testfiles+=(testsuite/"$testserie.${i}"*/*.exp)
else else
testfiles+=(testsuite/$testserie.${i}*/{010,999,$j}*.exp) testfiles+=(testsuite"/$testserie.${i}"*/{010,999,$j}*.exp)
fi fi
done done
# get file name of selected test files (runtest requires .exp file name) # get file name of selected test files (runtest requires .exp file name)
declare -a testfnames=() declare -a testfnames=()
for i in "${testfiles[@]}"; do for i in "${testfiles[@]}"; do
if [ -e $i ]; then if [ -e "$i" ]; then
fname=${i##*/} fname=${i##*/}
# build list of unique file names # build list of unique file names
if [ ${#testfnames[@]} -eq 0 ]\ if [ ${#testfnames[@]} -eq 0 ]\
|| [[ ! " ${testfnames[*]} " =~ " $fname " ]]; then || [[ ! " ${testfnames[*]} " =~ " $fname " ]]; then
testfnames+=($fname) testfnames+=($fname)
fi fi
fi fi
done done
# pass list to make target # pass list to make target
 End of changes. 8 change blocks. 
7 lines changed or deleted 49 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)