1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#! /usr/bin/env bash
#
# script to test a set of gem files
#
set -o errexit
set -o nounset
set -o pipefail
gems=$*
gem_platform_local=`ruby -e "puts Gem::Platform.local.to_s"`
function remove_all {
gem uninstall --all --force $1
}
function test_installation {
gem=$1
# test installation
remove_all sqlite3
gem install $gem
ruby -r sqlite3 -e 'pp SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION'
if [[ $gem =~ sqlite3-[^-]*\.gem ]] ; then
# test installation against system libs without mini_portile, linux distro repackagers
# (note that we don't care about running the gem in this case, just building it)
# see https://github.com/sparklemotion/sqlite3-ruby/pull/381 for background
remove_all sqlite3
remove_all mini_portile2
gem install --local --force $gem -- --enable-system-libraries
if gem list -i mini_portile2 ; then
echo "FAIL: should not have installed mini_portile2"
exit 1
fi
# test installation against system libs
remove_all sqlite3
gem install $gem -- --enable-system-libraries
ruby -r sqlite3 -e 'pp SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION'
fi
}
for gem in $gems ; do
./bin/test-gem-file-contents $gem
done
for gem in $gems ; do
if [[ $gem =~ sqlite3-[^-]+(-${gem_platform_local})?\.gem$ ]] ; then
test_installation $gem
fi
done
|