testHarness: adding git revision number to buildName

This commit is contained in:
Martin Beaudoin 2015-05-28 12:13:15 -04:00
parent aeebc7de3f
commit cf6fd9f57a
2 changed files with 16 additions and 0 deletions

View file

@ -124,6 +124,13 @@ if(GIT_FOUND)
OUTPUT_VARIABLE GIT_BRANCH_NAME OUTPUT_VARIABLE GIT_BRANCH_NAME
) )
message("Git branch: ${GIT_BRANCH_NAME}") message("Git branch: ${GIT_BRANCH_NAME}")
# We also add the git rev number to the build name
EXEC_PROGRAM(git
ARGS rev-parse --short=12 HEAD
OUTPUT_VARIABLE GIT_REV_NUMBER
)
message("Git rev: ${GIT_REV_NUMBER}")
if (GIT_BRANCH_NAME STREQUAL "") if (GIT_BRANCH_NAME STREQUAL "")
message("No git-branch. Mercurial?") message("No git-branch. Mercurial?")
EXEC_PROGRAM(hg EXEC_PROGRAM(hg
@ -136,6 +143,7 @@ if(GIT_FOUND)
message("Git branch (mercurial): ${GIT_BRANCH_NAME}") message("Git branch (mercurial): ${GIT_BRANCH_NAME}")
endif() endif()
SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}")
SET(BUILDNAME "${BUILDNAME}-git-rev=${GIT_REV_NUMBER}")
endif() endif()
# Some last minute cleanup # Some last minute cleanup

View file

@ -124,6 +124,13 @@ if(GIT_FOUND)
OUTPUT_VARIABLE GIT_BRANCH_NAME OUTPUT_VARIABLE GIT_BRANCH_NAME
) )
message("Git branch: ${GIT_BRANCH_NAME}") message("Git branch: ${GIT_BRANCH_NAME}")
# We also add the git rev number to the build name
EXEC_PROGRAM(git
ARGS rev-parse --short=12 HEAD
OUTPUT_VARIABLE GIT_REV_NUMBER
)
message("Git rev: ${GIT_REV_NUMBER}")
if (GIT_BRANCH_NAME STREQUAL "") if (GIT_BRANCH_NAME STREQUAL "")
message("No git-branch. Mercurial?") message("No git-branch. Mercurial?")
EXEC_PROGRAM(hg EXEC_PROGRAM(hg
@ -136,6 +143,7 @@ if(GIT_FOUND)
message("Git branch (mercurial): ${GIT_BRANCH_NAME}") message("Git branch (mercurial): ${GIT_BRANCH_NAME}")
endif() endif()
SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}")
SET(BUILDNAME "${BUILDNAME}-git-rev=${GIT_REV_NUMBER}")
endif() endif()
# Some last minute cleanup # Some last minute cleanup