Skip to content

Commit 5c8e329

Browse files
committed
test: test-gem-set checks compiled and loaded sqlite versions
Because we're about to mess around with CPPFLAGS and LDFLAGS.
1 parent 48b3e8d commit 5c8e329

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bin/test-gem-set

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ function remove_all {
1313
gem uninstall --all --force $1
1414
}
1515

16+
function assert_sqlite_version_matches {
17+
ruby -r sqlite3 -e '\
18+
puts "compiled #{SQLite3::SQLITE_VERSION} / loaded #{SQLite3::SQLITE_LOADED_VERSION}"; \
19+
raise("sqlite version mismatch") unless SQLite3::SQLITE_VERSION == SQLite3::SQLITE_LOADED_VERSION; \
20+
'
21+
}
22+
1623
function test_installation {
1724
gem=$1
1825

1926
# test installation
2027
remove_all sqlite3
2128
gem install $gem
22-
ruby -r sqlite3 -e 'pp SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION'
29+
assert_sqlite_version_matches
2330

2431
if [[ $gem =~ sqlite3-[^-]*\.gem ]] ; then
2532
# test installation against system libs without mini_portile, linux distro repackagers
@@ -36,7 +43,7 @@ function test_installation {
3643
# test installation against system libs
3744
remove_all sqlite3
3845
gem install $gem -- --enable-system-libraries
39-
ruby -r sqlite3 -e 'pp SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION'
46+
assert_sqlite_version_matches
4047
fi
4148
}
4249

0 commit comments

Comments
 (0)