11#! /bin/bash
22
3- # #############################################################################
4- #
5- #
6- # SCRIPT VARIABLES
7- #
8- #
9- # #############################################################################
103scriptname=` basename $0 `
114CI_FOLDER=" "
12- CI_PUBLIC =0
5+ CI_GENERIC =0
136CI_TUTORIAL=0
147TERM=" ${TERM:- xterm} "
158PROFILE=" "
@@ -31,7 +24,7 @@ Usage: $(tput setaf 1)$scriptname$(tput sgr0) $(tput setaf 3)[OPTIONS]$(tput sgr
3124 $( tput setaf 3) -i | --invocation$( tput sgr0) $( tput setaf 1) ARGS$( tput sgr0) invocation for modified user checks. Multiple \` -i' options are multiple invocations
3225 $( tput setaf 3) -l | --load-profile$( tput sgr0) $( tput setaf 1) ARGS$( tput sgr0) sources the given file before any execution of commands
3326 $( tput setaf 3) -m | --module-use$( tput sgr0) $( tput setaf 1) ARGS$( tput sgr0) executes module use of the give folder before loading the regression
34- $( tput setaf 3) -p | --public -only$( tput sgr0) executes only the public version of the unittests
27+ $( tput setaf 3) -g | --generic -only$( tput sgr0) executes unit tests using the generic configuration
3528 $( tput setaf 3) -t | --tutorial-only$( tput sgr0) executes only the modified/new tutorial tests
3629 $( tput setaf 3) -h | --help$( tput sgr0) prints this help and exits
3730
@@ -68,23 +61,25 @@ run_serial_user_checks()
6861}
6962
7063
71- # #############################################################################
72- #
73- #
74- # MAIN SCRIPT
75- #
76- #
77- # #############################################################################
64+ save_settings ()
65+ {
66+ tempfile=$( mktemp)
67+ cp reframe/settings.py $tempfile
68+ echo $tempfile
69+ }
7870
79- #
80- # Getting the machine name from the cmd line arguments
81- #
71+ restore_settings ()
72+ {
73+ saved=$1
74+ cp $saved reframe/settings.py
75+ /bin/rm $saved
76+ }
8277
83- #
84- # GNU Linux version
85- #
86- shortopts=" h,p ,t,f:,i:,l:,m:"
87- longopts=" help,public -only,tutorial-only,folder:,invocation:,load-profile:,module-use:"
78+
79+ # ## Main script ###
80+
81+ shortopts=" h,g ,t,f:,i:,l:,m:"
82+ longopts=" help,generic -only,tutorial-only,folder:,invocation:,load-profile:,module-use:"
8883
8984eval set -- $( getopt -o ${shortopts} -l ${longopts} \
9085 -n ${scriptname} -- " $@ " 2> /dev/null)
@@ -113,9 +108,9 @@ while [ $# -ne 0 ]; do
113108 -m | --module-use)
114109 shift
115110 MODULEUSE=" $1 " ;;
116- -p | --public -only)
111+ -g | --generic -only)
117112 shift
118- CI_PUBLIC =1 ;;
113+ CI_GENERIC =1 ;;
119114 -t | --tutorial-only)
120115 shift
121116 CI_TUTORIAL=1 ;;
@@ -162,19 +157,19 @@ module list
162157cd ${CI_FOLDER}
163158echo " Running regression on $( hostname) in ${CI_FOLDER} "
164159
165- if [ $CI_PUBLIC -eq 1 ]; then
160+ if [ $CI_GENERIC -eq 1 ]; then
166161 # Run unit tests for the public release
167- ln -sf ../config/generic.py reframe/settings.py
168-
169- echo " ================================="
170- echo " Running public release unit tests"
171- echo " ================================="
162+ echo " ========================================"
163+ echo " Running unit tests with generic settings"
164+ echo " ========================================"
172165 checked_exec ./test_reframe.py
173166 checked_exec ! ./bin/reframe.py --system=generic -l 2>&1 | \
174167 grep -- ' --- Logging error ---'
175168elif [ $CI_TUTORIAL -eq 1 ]; then
176169 # Run tutorial checks
177- ln -sf ../tutorial/config/settings.py reframe/settings.py
170+ settings_orig=$( save_settings)
171+ cp tutorial/config/settings.py reframe/settings.py
172+
178173 # Find modified or added tutorial checks
179174 tutorialchecks=( $( git log --name-status --oneline --no-merges -1 | \
180175 awk ' /^[AM]/ { print $2 } /^R0[0-9][0-9]/ { print $3 }' | \
@@ -186,20 +181,25 @@ elif [ $CI_TUTORIAL -eq 1 ]; then
186181 tutorialchecks_path=" ${tutorialchecks_path} -c ${check} "
187182 done
188183
189- echo " ===================="
184+ echo " ======================== "
190185 echo " Modified tutorial checks"
191- echo " ===================="
186+ echo " ======================== "
192187 echo ${tutorialchecks_path}
193188
194189 for i in ${! invocations[@]} ; do
195190 run_tutorial_checks ${tutorialchecks_path} ${invocations[i]}
196191 done
197192 fi
193+
194+ restore_settings $settings_orig
198195else
199196 # Performing the unittests
200197 echo " =================="
201198 echo " Running unit tests"
202199 echo " =================="
200+ settings_orig=$( save_settings)
201+ cp config/cscs.py reframe/settings.py
202+
203203 checked_exec ./test_reframe.py
204204
205205 # Find modified or added user checks
226226 run_serial_user_checks ${userchecks_path} ${invocations[i]}
227227 done
228228 fi
229+
230+ restore_settings $settings_orig
229231fi
230232exit $CI_EXITCODE
0 commit comments