Skip to content

Commit

Permalink
do_regtest: drop all references to Subversion
Browse files Browse the repository at this point in the history
fixes #7
  • Loading branch information
dev-zero committed Oct 4, 2018
1 parent fbb11ab commit b7bd6d1
Showing 1 changed file with 40 additions and 112 deletions.
152 changes: 40 additions & 112 deletions tools/regtesting/do_regtest
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ ndirstorestrict=0
restrict_dirs[1]=""
default_err_tolerance="1.0E-14"
mpiexec="mpiexec --bind-to none"
svnrec=

# parse options
while [ $# -ge 1 ]; do
Expand Down Expand Up @@ -94,9 +93,6 @@ while [ $# -ge 1 ]; do
# Perform no git pull
-nogit)
nogit="nogit";;
# Perform no svn update
-nosvn)
nosvn="nosvn";;
# do not reset reference outputs
-noreset)
noreset="noreset";;
Expand All @@ -106,13 +102,6 @@ while [ $# -ge 1 ]; do
# specify the full string "-D 2005-02-01" to get a check-out of a specific date
-farming)
farming="yes";;
-svndate)
svndate=$2
datum_short=${svndate}
shift;;
-svnrev)
svnrev=$2
shift;;
# do not check if code has changed
-noemptycheck)
emptycheck="NO";;
Expand All @@ -137,12 +126,7 @@ while [ $# -ge 1 ]; do
echo ""
echo "Git:"
echo " -nogit do not run git pull. Default: off."
echo ""
echo "Svn:"
echo " -svndate DATE checkout svn revision of given DATE. Default: use trunk."
echo " -svnrev REV checkout svn revision of given REV. Default: use trunk."
echo " -nosvn do not run svn update. Default: off."
echo " -noemptycheck run tests even when no changes in svn were made. Default: on."
echo " -noemptycheck run tests even when no changes in Git were made. Default: on."
echo ""
echo "Build:"
echo " -version VERSION VERSION passed to make. Default: sopt."
Expand All @@ -160,22 +144,22 @@ while [ $# -ge 1 ]; do
echo ""
echo "Testing:"
echo " -noreset do not reset the reference outputs. Default: off."
echo " -skiptest do not run test, only svn update and build. Default: off."
echo " -skiptest do not run test, only Git update and build. Default: off."
echo " -skipunittest do not run unit tests. Default: off."
echo " -skipdir TESTDIR do not run tests in TESTDIR. This switch can repeated."
echo " -restrictdir TESTDIR run only tests in TESTDIR. This switch can repeated."
echo " -retest run only tests in directories, which had failing tests in previous run."
echo ""
echo "Exit codes:"
echo " 0 clean exit with testing"
echo " 1 problem with svn update"
echo " 1 problem with Git update"
echo " 3 problem with realclean"
echo " 4 build errors"
echo " 5 problem with retest option - no TEST directory with latest test results found"
echo " 6 problem with retest option - no error summary exists in the last TEST directory"
echo " 7 reference directory is locked"
echo " 8 ctrl-C (SIGINT) and various other signals trapped"
echo " 100 no svn changes since last run - clean exit without testing"
echo " 100 no Git changes since last run - clean exit without testing"
echo ""
echo "For more information visit: <http://cp2k.org/dev:regtesting>"
exit 0;;
Expand Down Expand Up @@ -203,7 +187,6 @@ emptycheck=${emptycheck:-"NO"}
leakcheck=${leakcheck:-"NO"}
doretest=${doretest:-"no"}
nogit=${nogit:-"git"}
nosvn=${nosvn:-"svn"}
nobuild=${nobuild:-"build"}
cp2k_run_postfix=${cp2k_run_postfix:-""}
make=${make:-make}
Expand All @@ -213,7 +196,7 @@ noreset=${noreset:-"reset"}
skiptest=${skiptest:-"noskiptest"}
do_unit_test=${do_unit_test:-"yes"}
farming=${farming:-"no"}
svndate=${svndate:-"$datum_full"}
date="${datum_full}"
#
# guessing the number of tasks / threads / ranks
#
Expand Down Expand Up @@ -288,7 +271,6 @@ changelog_tests_new=${changelog_tests}.new
changelog_tests_old=${changelog_tests}.old
mkdir -p ${dir_out}
mkdir -p ${dir_last}
svn_out=${dir_out}/svn.out
git_out=${dir_out}/git.out
make_out=${dir_out}/make.out
error_description_file=${dir_out}/error_summary
Expand Down Expand Up @@ -722,11 +704,6 @@ echo " regtesting location last dir: $dir_last"
# Start testing
echo "*************************** testing started ******************************"
echo " started on " `date`
if [ -z "$svnver" ]; then
echo " checking version ${svndate} "
else
echo " checking version ${svnrev} "
fi
echo " configuration: ${dir_triplet}-${cp2k_version} "
file_info
#
Expand All @@ -747,19 +724,14 @@ echo "emptycheck = ${emptycheck}"
echo "leakcheck = ${leakcheck}"
echo "doretest = ${doretest}"
echo "nogit = ${nogit}"
echo "nosvn = ${nosvn}"
echo "nobuild = ${nobuild}"
echo "quick = ${quick}"
echo "noreset = ${noreset}"
echo "skiptest = ${skiptest}"
echo "do_unit_test = ${do_unit_test}"
echo "farming = ${farming}"
echo "maxbuildtasks = ${maxbuildtasks}"
if [ -z "$svnver" ]; then
echo "svndate = ${svndate}"
else
echo "svnrev = ${svnrev}"
fi

t=1
while [ $t -le ${ndirstoskip} ]; do
echo "skip_dirs = ${skip_dirs[t]}"
Expand All @@ -770,96 +742,52 @@ while [ $t -le ${ndirstorestrict} ]; do
echo "restrict_dirs = ${restrict_dirs[t]}"
let t=t+1
done
# Check for svn and perform update if requested
echo "--------------------------- SVN ------------------------------------------"
if svn info ${repo_dir} &>/dev/null; then
if [[ ${nosvn} != "nosvn" ]]; then
cd ${repo_dir}
# If ChangeLog does not exist for the first time, it is created
if [[ ! -s ${changelog} ]]; then
echo "Creating ChangeLog file for the first time. This may take a while ..."
${repo_dir}/tools/svn2cl/svn2cl.sh -i -o ${changelog}

echo "--------------------------- GIT ------------------------------------------"
if git -C ${repo_dir} rev-parse &>/dev/null; then
if [[ ${nogit} != "nogit" ]]; then
sha1_old=$(git -C ${repo_dir} log -1 --pretty='%H')
git -C ${repo_dir} log --pretty="CommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitAuthorEmail: %ae%nCommitSubject: %s%n#" >${changelog_old}
git -C ${repo_dir} pull &>${git_out}
if (( $? )); then
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >>${error_description_file}
cat ${git_out} >>${error_description_file}
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >>${error_description_file}
echo "ERROR: git -C ${repo_dir} pull failed ... bailing out" >>${error_description_file}
cat "${error_description_file}"
end_test 1 ${lockfile}
fi
for d in src data tests tools; do
echo "Updating $d ..."
if [ -z "$svnver" ]; then
svn update -r {${svndate}} $d &>${svn_out}
else
svn update -r ${svnrev} $d &>${svn_out}
fi
if (( $? )); then
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >>${error_description_file}
cat ${svn_out} >>${error_description_file}
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >>${error_description_file}
echo "ERROR: svn update $d failed ... bailing out" >>${error_description_file}
cat "${error_description_file}"
end_test 1 ${lockfile}
fi
cat ${svn_out}
done
# cp2k_lines=`wc *.F | tail -1 | ${awk} '{print $1}'`
# echo "cp2k is now ${cp2k_lines} lines .F"
sha1_new=$(git -C ${repo_dir} log -1 --pretty='%H')
git -C ${repo_dir} log --pretty="CommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitAuthorEmail: %ae%nCommitSubject: %s%n#" >${changelog}
cat ${git_out}
echo "--------------------------- ChangeLog diff -------------------------------"
# Using svn2cl.pl to generate GNU like ChangeLog
${repo_dir}/tools/svn2cl/svn2cl.sh --limit 100 -i -o ${changelog_new} >>${error_description_file} 2>&1
line1="$(head -n 1 ${changelog})"
nline=$(grep -n "${line1}" ${changelog_new} | head -n 1 | cut -f 1 -d:)
mv ${changelog} ${changelog_old}
head -n $((nline - 1)) ${changelog_new} >${changelog}
cat ${changelog_old} >>${changelog}
diff ${changelog} ${changelog_old} >${changelog_diff}
line1="$(head -n 1 ${changelog_old})"
nline=$(grep -n "${line1}" ${changelog} | head -n 1 | cut -f 1 -d:)
head -n $(( nline - 1 )) ${changelog} >${changelog_diff}
cat ${changelog_diff}
rm ${changelog_new} ${changelog_old}
rm ${changelog_old}
else
echo "No svn update has been performed due to user request"
echo "No git pull has been performed due to user request"
fi
else
echo "No svn repository found in ${repo_dir}"
echo "--------------------------- GIT ------------------------------------------"
if git -C ${repo_dir} rev-parse &>/dev/null; then
if [[ ${nogit} != "nogit" ]]; then
sha1_old=$(git -C ${repo_dir} log -1 --pretty='%H')
git -C ${repo_dir} log --pretty="CommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitAuthorEmail: %ae%nCommitSubject: %s%n#" >${changelog_old}
git -C ${repo_dir} pull &>${git_out}
if (( $? )); then
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >>${error_description_file}
cat ${git_out} >>${error_description_file}
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >>${error_description_file}
echo "ERROR: git -C ${repo_dir} pull failed ... bailing out" >>${error_description_file}
cat "${error_description_file}"
end_test 1 ${lockfile}
fi
sha1_new=$(git -C ${repo_dir} log -1 --pretty='%H')
git -C ${repo_dir} log --pretty="CommitSHA: %H%nCommitTime: %ci%nCommitAuthor: %an%nCommitAuthorEmail: %ae%nCommitSubject: %s%n#" >${changelog}
cat ${git_out}
echo "--------------------------- ChangeLog diff -------------------------------"
line1="$(head -n 1 ${changelog_old})"
nline=$(grep -n "${line1}" ${changelog} | head -n 1 | cut -f 1 -d:)
head -n $(( nline - 1 )) ${changelog} >${changelog_diff}
cat ${changelog_diff}
rm ${changelog_old}
else
echo "No git pull has been performed due to user request"
fi
else
if [[ ${nogit} != "nogit" ]]; then
if git --version &>/dev/null; then
git_version=$(git --version | awk '{print $3}' | cut -d. -f1)
if (( git_version < 2 )); then
echo "$(git --version) is too old"
echo "No update of the git repository ${repo_dir} was performed"
else
echo "No git repository found in ${repo_dir}"
fi
if [[ ${nogit} != "nogit" ]]; then
if git --version &>/dev/null; then
git_version=$(git --version | awk '{print $3}' | cut -d. -f1)
if (( git_version < 2 )); then
echo "$(git --version) is too old"
echo "No update of the git repository ${repo_dir} was performed"
else
echo "git is not installed"
echo "No git repository found in ${repo_dir}"
fi
else
echo "No git pull has been performed due to user request"
echo "git is not installed"
fi
else
echo "No git pull has been performed due to user request"
fi
fi


echo "--------------------------- Preparations ---------------------------------"

# Check if there is any update or difference that thus requires a rerun
Expand Down Expand Up @@ -933,7 +861,7 @@ if [[ ${skiptest} != "skiptest" ]]; then

###################################################################################
#
# parse the TEST_TYPES file to do different kinds of test (done after svn update)
# parse the TEST_TYPES file to do different kinds of test (done after Git update)
#
# tests grep for the last line in the file where a string matches (test_grep)
# and compares a numeric field at a given column (test_col)
Expand Down

0 comments on commit b7bd6d1

Please sign in to comment.