Skip to content

Commit

Permalink
Integrated version number check in installtion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bernedom committed Aug 3, 2019
1 parent 14aa0c6 commit eec0f55
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/installation-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,18 @@ testCpackInstallation(){

}

testVersionNumberConsistency()
{
CHANGELOG_VERSION=$(sed -n -E '/## [0-9]+\.[0-9]+\.[0-9]+/p' ${ROOT_DIR}/CHANGELOG.md | head -1 | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+')
ORIG_DIR=$(pwd)
cmake ${ROOT_DIR} -B${SI_BUILD_DIR} -DBUILD_TESTING=off -G Ninja
cd ${SI_BUILD_DIR}
CMAKE_VERSION=$(cmake --system-information|grep -E "VERSION:STATIC"|grep -E -o '[0-9]+\.[0-9]+\.[0-9]+')
cd ${ORIG_DIR}

assertEquals "version in changelog (${CHANGELOG_VERSION}) does not match cmake version (${CMAKE_VERSION})" $CHANGELOG_VERSION $CMAKE_VERSION

}

# Load shUnit2.
. shunit2

0 comments on commit eec0f55

Please sign in to comment.