Feature: Adaption of Test-Scripts for Mercurial. Author: Bernhard Gschaider. Merge: Hrvoje Jasak.

This commit is contained in:
Hrvoje Jasak 2015-08-24 20:55:00 +01:00
commit ecbb9f3212
6 changed files with 90 additions and 22 deletions

View file

@ -79,10 +79,10 @@ SET(
CACHE STRING "Build ID"
)
# We allow overriding the git branch and revision information with some
# We allow overriding the git branch and revision information with some
# user-supplied information using the CDASH_SCM_INFO environment variable.
#
# Mercurial or other SCM users should be using this environment variable
# Mercurial or other SCM users should be using this environment variable
# in order to provide branch and revision information for the buildname.
#
# Git users should use this environment variable in order to provide
@ -137,7 +137,7 @@ if(NOT BUILDNAME_SCM_INFO STREQUAL "")
elseif(GIT_FOUND)
message("The git command was found: ${GIT_EXECUTABLE}")
# Check if the source code is under a valid git repository
execute_process(
COMMAND git status
@ -164,11 +164,43 @@ elseif(GIT_FOUND)
SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}")
SET(BUILDNAME "${BUILDNAME}-git-rev=${GIT_REV_NUMBER}")
else()
# Not a git repository: no branch nor revision information available
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
SET(BUILDNAME "${BUILDNAME}-git-rev=unknown")
endif()
else()
execute_process(
COMMAND hg id
WORKING_DIRECTORY ${FOAM_ROOT}
OUTPUT_VARIABLE HG_STATUS
RESULT_VARIABLE HG_ECODE
ERROR_QUIET
)
if(NOT HG_ECODE)
# We have a valid git repository. Grab the branch and revision info.
# Add to the build name
message("No git-branch. Mercurial?")
EXEC_PROGRAM(hg
ARGS id --bookmarks
OUTPUT_VARIABLE GIT_BRANCH_NAME
)
EXEC_PROGRAM(hg
ARGS id --id
OUTPUT_VARIABLE GIT_REV_NUMBER
)
EXEC_PROGRAM(hg
ARGS log --template='git_{gitnode|short}' -l 1
OUTPUT_VARIABLE GIT_REAL_REV_NUMBER
)
string(REPLACE " " "_" GIT_BRANCH_NAME ${GIT_BRANCH_NAME})
string(REPLACE "+" ":modified" GIT_REV_NUMBER ${GIT_REV_NUMBER})
SET(GIT_REV_NUMBER "${GIT_REV_NUMBER}_${GIT_REAL_REV_NUMBER}")
message("Git branch (mercurial): ${GIT_BRANCH_NAME} Revision: ${GIT_REV_NUMBER}")
SET(BUILDNAME "${BUILDNAME}-hg-branch=${GIT_BRANCH_NAME}")
SET(BUILDNAME "${BUILDNAME}-hg-rev=${GIT_REV_NUMBER}")
else()
# Not a git or mercurial repository: no branch nor revision information available
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
SET(BUILDNAME "${BUILDNAME}-git-rev=unknown")
endif()
endif()
else()
# Git is not available: no branch nor revision information supplied
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
@ -182,6 +214,8 @@ string(REPLACE " " "_" BUILDNAME ${BUILDNAME})
string(REPLACE "/" "_" SITE ${SITE})
string(REPLACE " " "_" SITE ${SITE})
message("Build name: ${BUILDNAME}")
# Build section
#-----------------------------------------------------------------------------

View file

@ -79,10 +79,10 @@ SET(
CACHE STRING "Build ID"
)
# We allow overriding the git branch and revision information with some
# We allow overriding the git branch and revision information with some
# user-supplied information using the CDASH_SCM_INFO environment variable.
#
# Mercurial or other SCM users should be using this environment variable
# Mercurial or other SCM users should be using this environment variable
# in order to provide branch and revision information for the buildname.
#
# Git users should use this environment variable in order to provide
@ -137,7 +137,7 @@ if(NOT BUILDNAME_SCM_INFO STREQUAL "")
elseif(GIT_FOUND)
message("The git command was found: ${GIT_EXECUTABLE}")
# Check if the source code is under a valid git repository
execute_process(
COMMAND git status
@ -164,11 +164,43 @@ elseif(GIT_FOUND)
SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}")
SET(BUILDNAME "${BUILDNAME}-git-rev=${GIT_REV_NUMBER}")
else()
# Not a git repository: no branch nor revision information available
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
SET(BUILDNAME "${BUILDNAME}-git-rev=unknown")
endif()
else()
execute_process(
COMMAND hg id
WORKING_DIRECTORY ${FOAM_ROOT}
OUTPUT_VARIABLE HG_STATUS
RESULT_VARIABLE HG_ECODE
ERROR_QUIET
)
if(NOT HG_ECODE)
# We have a valid git repository. Grab the branch and revision info.
# Add to the build name
message("No git-branch. Mercurial?")
EXEC_PROGRAM(hg
ARGS id --bookmarks
OUTPUT_VARIABLE GIT_BRANCH_NAME
)
EXEC_PROGRAM(hg
ARGS id --id
OUTPUT_VARIABLE GIT_REV_NUMBER
)
EXEC_PROGRAM(hg
ARGS log --template='git_{gitnode|short}' -l 1
OUTPUT_VARIABLE GIT_REAL_REV_NUMBER
)
string(REPLACE " " "_" GIT_BRANCH_NAME ${GIT_BRANCH_NAME})
string(REPLACE "+" ":modified" GIT_REV_NUMBER ${GIT_REV_NUMBER})
SET(GIT_REV_NUMBER "${GIT_REV_NUMBER}_${GIT_REAL_REV_NUMBER}")
message("Git branch (mercurial): ${GIT_BRANCH_NAME} Revision: ${GIT_REV_NUMBER}")
SET(BUILDNAME "${BUILDNAME}-hg-branch=${GIT_BRANCH_NAME}")
SET(BUILDNAME "${BUILDNAME}-hg-rev=${GIT_REV_NUMBER}")
else()
# Not a git or mercurial repository: no branch nor revision information available
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
SET(BUILDNAME "${BUILDNAME}-git-rev=unknown")
endif()
endif()
else()
# Git is not available: no branch nor revision information supplied
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
@ -182,6 +214,8 @@ string(REPLACE " " "_" BUILDNAME ${BUILDNAME})
string(REPLACE "/" "_" SITE ${SITE})
string(REPLACE " " "_" SITE ${SITE})
message("Build name: ${BUILDNAME}")
# Build section
#-----------------------------------------------------------------------------

View file

@ -24,11 +24,11 @@
One can then connect to the virtual machine with
: vagrant ssh <machinName>
and will be in the =$HOME= directory of the user =vagrant= where in
the directory =~/foam/foam-extend-3.1= the sources are
the directory =~/foam/foam-extend-3.2= the sources are
available. Modifications can be pushed "outside" the virtual machine
with
: hg push
There is also a symbolic link =~/foam/foam-extend-3.1-parent=
There is also a symbolic link =~/foam/foam-extend-3.2-parent=
to the sources if you want to edit there directly. Use with care
and don't compile in that directory unless you know what you're
doing

View file

@ -29,7 +29,7 @@ chown -R vagrant:vagrant $OFDIR
# for distros that don't have group vagrant
chown -R vagrant $OFDIR
OFClone=$OFDIR/foam-extend-3.1
OFClone=$OFDIR/foam-extend-3.2
OFReference=$OFClone-parent
OFParent=/FOAM-sources

View file

@ -2,10 +2,10 @@
/home/vagrant/bootstrapFoam.sh
cd foam/foam-extend-3.1
cd foam/foam-extend-3.2
source etc/bashrc
cd testHarness/foam-extend/3.1/runDir
cd testHarness/foam-extend/3.2/runDir
./Allclean

View file

@ -6,7 +6,7 @@ export CCACHE_DIR=/vagrant/ccache4vm
BOOTSTRAPLOG=/home/vagrant/bootstrapFoam.log
cd foam/foam-extend-3.1
cd foam/foam-extend-3.2
source etc/bashrc
( cd wmake/src && make )