diff options
Diffstat (limited to 'third_party/sqlite/test/loadext.test')
-rw-r--r-- | third_party/sqlite/test/loadext.test | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/third_party/sqlite/test/loadext.test b/third_party/sqlite/test/loadext.test index e0fecd3..db5745b 100644 --- a/third_party/sqlite/test/loadext.test +++ b/third_party/sqlite/test/loadext.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is extension loading. # -# $Id: loadext.test,v 1.14 2008/08/02 03:50:39 drh Exp $ +# $Id: loadext.test,v 1.17 2009/03/20 09:09:37 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -23,12 +23,12 @@ ifcapable !load_ext { # The name of the test extension varies by operating system. # -if {$::tcl_platform(platform) eq "windows"} { +if {$::tcl_platform(platform) eq "windows" || $::tcl_platform(platform) eq "os2"} { set testextension ./testloadext.dll } else { set testextension ./libtestloadext.so } -set gcc_shared -shared +set gcc_shared "-shared -fPIC" if {$::tcl_platform(os) eq "Darwin"} { set gcc_shared -dynamiclib } @@ -62,8 +62,7 @@ set dlerror_nosymbol {%s: undefined symbol: %s} if {$::tcl_platform(os) eq "Darwin"} { set dlerror_nosuchfile {dlopen(%s, 10): image not found} - set dlerror_notadll {dlopen(%1$s, 10): no suitable image found. Did find: - %1$s: file to short} + set dlerror_notadll {dlopen(%1$s, 10): no suitable image found.*} set dlerror_nosymbol {dlsym(XXX, %2$s): symbol not found} } @@ -74,9 +73,11 @@ if {$::tcl_platform(os) eq "Darwin"} { if {![file exists $testextension]} { set srcdir [file dir $testdir]/src set testextsrc $srcdir/test_loadext.c - if {[catch { - exec gcc $gcc_shared -Wall -I$srcdir -I. -g $testextsrc -o $testextension - } msg]} { + + set cmdline [concat exec gcc $gcc_shared] + lappend cmdline -Wall -I$srcdir -I. -g $testextsrc -o $testextension + + if {[catch $cmdline msg]} { puts "Skipping loadext tests: Test extension not built..." puts $msg finish_test @@ -149,8 +150,9 @@ do_test loadext-2.2 { set rc [catch { sqlite3_load_extension db "${testextension}xx" } msg] - list $rc $msg -} [list 1 [format $dlerror_notadll ${testextension}xx]] + set expected_error_pattern [format $dlerror_notadll ${testextension}xx] + list $rc [string match $expected_error_pattern $msg] +} [list 1 1] # Try to load an extension for which the file is present but the # entry point is not. |