Skip to content

Commit

Permalink
Add version number test.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 18, 2014
1 parent 3529a41 commit 8a7ae41
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -49,6 +49,7 @@ matrix:
jdk: openjdk7
- env: TARGET='-Pj2ee'
jdk: oraclejdk7
- script: test/check_versions.sh
fast_finish: true
allow_failures:
- env: TARGET='-Pcomplete'
Expand Down
72 changes: 72 additions & 0 deletions test/check_versions.sh
@@ -0,0 +1,72 @@
#!/bin/bash

# Checks that the artefacts produced by the JRuby build system have the correct
# names and versions.

jar_version=`cat VERSION`
gem_version=${jar_version/-/.}

rm -rf maven/*/target/*

mvn install -Pbootstrap
mvn -Pcomplete
mvn -Pdist
mvn -Pjruby-jars
mvn -Pjruby-tests
mvn -Pmain

declare -a failed
failed[0]=0

function check {
archive=$1
unpackaged=$2

if [ ! -f $archive ]
then
echo $archive was not found - check your version numbers
failed[0]=1
fi

if [[ $archive == *.tar.gz ]]
then
rm -rf $unpackaged
tar -zxf $archive

if [ ! -d $unpackaged ]
then
echo $archive did not untar to $unpackaged - check your version numbers
failed[0]=1
fi
fi

if [[ $archive == *.zip ]]
then
rm -rf $unpackaged
unzip -q $archive

if [ ! -d $unpackaged ]
then
echo $archive did not unzip to $unpackaged - check your version numbers
failed[0]=1
fi
fi
}

check test/target/jruby-tests-$jar_version.jar
check maven/jruby-stdlib/target/jruby-stdlib-$jar_version.jar
check maven/jruby-jars/pkg/jruby-jars-$gem_version.gem
check maven/jruby-jars/lib/jruby-core-$jar_version.jar
check maven/jruby-jars/lib/jruby-stdlib-$jar_version.jar
check maven/jruby-complete/target/jruby-complete-$jar_version.jar
check maven/jruby/target/jruby-$jar_version.jar
check maven/jruby-noasm/target/jruby-noasm-$jar_version.jar
check maven/jruby-dist/target/jruby-dist-$jar_version-bin.tar.gz jruby-$jar_version
check maven/jruby-dist/target/jruby-dist-$jar_version-src.tar.gz jruby-$jar_version
check maven/jruby-dist/target/jruby-dist-$jar_version-src.zip jruby-$jar_version
check maven/jruby-dist/target/jruby-dist-$jar_version-bin.zip jruby-$jar_version
check core/target/jruby-core-$jar_version-noasm.jar
check core/target/jruby-core-$jar_version.jar
check core/target/jruby-core-$jar_version-complete.jar

exit "${failed[0]}"

0 comments on commit 8a7ae41

Please sign in to comment.