Skip to content

Commit

Permalink
test: test-gem-set checks compiled and loaded sqlite versions
Browse files Browse the repository at this point in the history
Because we're about to mess around with CPPFLAGS and LDFLAGS.
  • Loading branch information
flavorjones committed Sep 10, 2023
1 parent 48b3e8d commit 5c8e329
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/test-gem-set
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ function remove_all {
gem uninstall --all --force $1
}

function assert_sqlite_version_matches {
ruby -r sqlite3 -e '\
puts "compiled #{SQLite3::SQLITE_VERSION} / loaded #{SQLite3::SQLITE_LOADED_VERSION}"; \
raise("sqlite version mismatch") unless SQLite3::SQLITE_VERSION == SQLite3::SQLITE_LOADED_VERSION; \
'
}

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'
assert_sqlite_version_matches

if [[ $gem =~ sqlite3-[^-]*\.gem ]] ; then
# test installation against system libs without mini_portile, linux distro repackagers
Expand All @@ -36,7 +43,7 @@ function test_installation {
# 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'
assert_sqlite_version_matches
fi
}

Expand Down

0 comments on commit 5c8e329

Please sign in to comment.