aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/misc/base85.c3
-rw-r--r--ext/rbu/rbu1.test1
-rw-r--r--ext/rbu/rbu10.test7
-rw-r--r--ext/rbu/rbu11.test6
-rw-r--r--ext/rbu/rbu12.test6
-rw-r--r--ext/rbu/rbu13.test6
-rw-r--r--ext/rbu/rbu14.test6
-rw-r--r--ext/rbu/rbu3.test6
-rw-r--r--ext/rbu/rbu5.test1
-rw-r--r--ext/rbu/rbu6.test6
-rw-r--r--ext/rbu/rbu7.test6
-rw-r--r--ext/rbu/rbu8.test6
-rw-r--r--ext/rbu/rbu9.test6
-rw-r--r--ext/rbu/rbuA.test6
-rw-r--r--ext/rbu/rbuB.test1
-rw-r--r--ext/rbu/rbuC.test1
-rw-r--r--ext/rbu/rbubusy.test1
-rw-r--r--ext/rbu/rbucollate.test1
-rw-r--r--ext/rbu/rbucrash.test6
-rw-r--r--ext/rbu/rbucrash2.test6
-rw-r--r--ext/rbu/rbudiff.test7
-rw-r--r--ext/rbu/rbudor.test6
-rw-r--r--ext/rbu/rbuexlock.test1
-rw-r--r--ext/rbu/rbuexpr.test1
-rw-r--r--ext/rbu/rbufault.test6
-rw-r--r--ext/rbu/rbufault2.test6
-rw-r--r--ext/rbu/rbufault3.test1
-rw-r--r--ext/rbu/rbufault4.test6
-rw-r--r--ext/rbu/rbufts.test6
-rw-r--r--ext/rbu/rbumisc.test1
-rw-r--r--ext/rbu/rbumulti.test1
-rw-r--r--ext/rbu/rbupartial.test1
-rw-r--r--ext/rbu/rbupass.test1
-rw-r--r--ext/rbu/rbuprogress.test1
-rw-r--r--ext/rbu/rburename.test1
-rw-r--r--ext/rbu/rburesume.test1
-rw-r--r--ext/rbu/rbusave.test6
-rw-r--r--ext/rbu/rbusplit.test1
-rw-r--r--ext/rbu/rbutemplimit.test1
-rw-r--r--ext/rbu/rbuvacuum.test1
-rw-r--r--ext/rbu/rbuvacuum2.test1
-rw-r--r--ext/rbu/rbuvacuum3.test1
-rw-r--r--ext/rbu/rbuvacuum4.test1
-rw-r--r--ext/wasm/GNUmakefile21
-rw-r--r--ext/wasm/api/extern-post-js.c-pp.js23
-rw-r--r--ext/wasm/api/pre-js.c-pp.js4
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js21
-rw-r--r--ext/wasm/tester1-worker.html8
-rw-r--r--ext/wasm/tester1.c-pp.html8
-rw-r--r--ext/wasm/tester1.c-pp.js8
50 files changed, 115 insertions, 125 deletions
diff --git a/ext/misc/base85.c b/ext/misc/base85.c
index 019136874..5ec136dbc 100644
--- a/ext/misc/base85.c
+++ b/ext/misc/base85.c
@@ -171,7 +171,8 @@ static char* toBase85( u8 *pIn, int nbIn, char *pOut, char *pSep ){
int nCol = 0;
while( nbIn >= 4 ){
int nco = 5;
- unsigned long qbv = (pIn[0]<<24)|(pIn[1]<<16)|(pIn[2]<<8)|pIn[3];
+ unsigned long qbv = (((unsigned long)pIn[0])<<24) |
+ (pIn[1]<<16) | (pIn[2]<<8) | pIn[3];
while( nco > 0 ){
unsigned nqv = (unsigned)(qbv/85UL);
unsigned char dv = qbv - 85UL*nqv;
diff --git a/ext/rbu/rbu1.test b/ext/rbu/rbu1.test
index 9237dbcea..2c3860e80 100644
--- a/ext/rbu/rbu1.test
+++ b/ext/rbu/rbu1.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu1
db close
diff --git a/ext/rbu/rbu10.test b/ext/rbu/rbu10.test
index aa4db8a29..7f75dbfa7 100644
--- a/ext/rbu/rbu10.test
+++ b/ext/rbu/rbu10.test
@@ -10,13 +10,10 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu10
-
#--------------------------------------------------------------------
# Test that UPDATE commands work even if the input columns are in a
# different order to the output columns.
diff --git a/ext/rbu/rbu11.test b/ext/rbu/rbu11.test
index 5a4219b00..4b711721e 100644
--- a/ext/rbu/rbu11.test
+++ b/ext/rbu/rbu11.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu11
diff --git a/ext/rbu/rbu12.test b/ext/rbu/rbu12.test
index 7816bfe89..6e27ba692 100644
--- a/ext/rbu/rbu12.test
+++ b/ext/rbu/rbu12.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/lock_common.tcl
set ::testprefix rbu12
diff --git a/ext/rbu/rbu13.test b/ext/rbu/rbu13.test
index 624c587cc..45b84f2b1 100644
--- a/ext/rbu/rbu13.test
+++ b/ext/rbu/rbu13.test
@@ -13,10 +13,8 @@
# for UPDATE statements. This tests RBU's internal UPDATE statement cache.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/lock_common.tcl
set ::testprefix rbu13
diff --git a/ext/rbu/rbu14.test b/ext/rbu/rbu14.test
index 07f678409..18114ec7a 100644
--- a/ext/rbu/rbu14.test
+++ b/ext/rbu/rbu14.test
@@ -13,10 +13,8 @@
# table.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/lock_common.tcl
set ::testprefix rbu14
diff --git a/ext/rbu/rbu3.test b/ext/rbu/rbu3.test
index da87561fb..fe2afdc05 100644
--- a/ext/rbu/rbu3.test
+++ b/ext/rbu/rbu3.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu3
diff --git a/ext/rbu/rbu5.test b/ext/rbu/rbu5.test
index 3696dfb87..02ecf6be1 100644
--- a/ext/rbu/rbu5.test
+++ b/ext/rbu/rbu5.test
@@ -13,6 +13,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu5
diff --git a/ext/rbu/rbu6.test b/ext/rbu/rbu6.test
index bb5b17f42..cddd93870 100644
--- a/ext/rbu/rbu6.test
+++ b/ext/rbu/rbu6.test
@@ -13,10 +13,8 @@
# outcome of some other client writing to the database while an RBU update
# is being applied.
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu6
proc setup_test {} {
diff --git a/ext/rbu/rbu7.test b/ext/rbu/rbu7.test
index 1e3bc174d..e8ec0343d 100644
--- a/ext/rbu/rbu7.test
+++ b/ext/rbu/rbu7.test
@@ -13,10 +13,8 @@
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu7
# Test index:
diff --git a/ext/rbu/rbu8.test b/ext/rbu/rbu8.test
index c0ccd8c5e..86e931482 100644
--- a/ext/rbu/rbu8.test
+++ b/ext/rbu/rbu8.test
@@ -12,10 +12,8 @@
# Test the rbu_delta() feature.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu8
do_execsql_test 1.0 {
diff --git a/ext/rbu/rbu9.test b/ext/rbu/rbu9.test
index 0efdc1dde..fe808b3ac 100644
--- a/ext/rbu/rbu9.test
+++ b/ext/rbu/rbu9.test
@@ -12,10 +12,8 @@
# Test RBU with virtual tables. And tables with no PRIMARY KEY declarations.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbu9
ifcapable !fts3 {
diff --git a/ext/rbu/rbuA.test b/ext/rbu/rbuA.test
index 642caca19..cdc0c8040 100644
--- a/ext/rbu/rbuA.test
+++ b/ext/rbu/rbuA.test
@@ -14,10 +14,8 @@
# a wal mode database via RBU.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuA
set db_sql {
diff --git a/ext/rbu/rbuB.test b/ext/rbu/rbuB.test
index 6eb917e57..fca755a4b 100644
--- a/ext/rbu/rbuB.test
+++ b/ext/rbu/rbuB.test
@@ -12,6 +12,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuB
db close
diff --git a/ext/rbu/rbuC.test b/ext/rbu/rbuC.test
index ff3d4d507..430b14418 100644
--- a/ext/rbu/rbuC.test
+++ b/ext/rbu/rbuC.test
@@ -13,6 +13,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuC
#-------------------------------------------------------------------------
diff --git a/ext/rbu/rbubusy.test b/ext/rbu/rbubusy.test
index 8cc47db8f..088711405 100644
--- a/ext/rbu/rbubusy.test
+++ b/ext/rbu/rbubusy.test
@@ -12,6 +12,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbubusy
db close
diff --git a/ext/rbu/rbucollate.test b/ext/rbu/rbucollate.test
index ccc097624..52f6ba373 100644
--- a/ext/rbu/rbucollate.test
+++ b/ext/rbu/rbucollate.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbucollate
ifcapable !icu_collations {
diff --git a/ext/rbu/rbucrash.test b/ext/rbu/rbucrash.test
index 34ac2c86f..c2132bc3d 100644
--- a/ext/rbu/rbucrash.test
+++ b/ext/rbu/rbucrash.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbucrash
db close
diff --git a/ext/rbu/rbucrash2.test b/ext/rbu/rbucrash2.test
index 9ff6eba4f..683de8849 100644
--- a/ext/rbu/rbucrash2.test
+++ b/ext/rbu/rbucrash2.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbucrash2
db close
diff --git a/ext/rbu/rbudiff.test b/ext/rbu/rbudiff.test
index 5c2bf9bee..b165cf2be 100644
--- a/ext/rbu/rbudiff.test
+++ b/ext/rbu/rbudiff.test
@@ -12,10 +12,9 @@
# Tests for the [sqldiff --rbu] command.
#
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set testprefix rbudiff
set PROG [test_find_sqldiff]
diff --git a/ext/rbu/rbudor.test b/ext/rbu/rbudor.test
index df4d934de..684b43a94 100644
--- a/ext/rbu/rbudor.test
+++ b/ext/rbu/rbudor.test
@@ -13,10 +13,8 @@
# enabled by SQLITE_DIRECT_OVERFLOW_READ - Direct Overflow Read.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbudor
set bigA [string repeat a 5000]
diff --git a/ext/rbu/rbuexlock.test b/ext/rbu/rbuexlock.test
index eddcdc115..570489cbc 100644
--- a/ext/rbu/rbuexlock.test
+++ b/ext/rbu/rbuexlock.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuexlock
db close
diff --git a/ext/rbu/rbuexpr.test b/ext/rbu/rbuexpr.test
index a392c4ed8..724a0f131 100644
--- a/ext/rbu/rbuexpr.test
+++ b/ext/rbu/rbuexpr.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuexpr
db close
diff --git a/ext/rbu/rbufault.test b/ext/rbu/rbufault.test
index 247a99189..fb3efb972 100644
--- a/ext/rbu/rbufault.test
+++ b/ext/rbu/rbufault.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/malloc_common.tcl
set ::testprefix rbufault
diff --git a/ext/rbu/rbufault2.test b/ext/rbu/rbufault2.test
index 36f2b6b6f..4bf53a17f 100644
--- a/ext/rbu/rbufault2.test
+++ b/ext/rbu/rbufault2.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/malloc_common.tcl
set ::testprefix rbufault2
diff --git a/ext/rbu/rbufault3.test b/ext/rbu/rbufault3.test
index 4f690284a..b7ba54f6a 100644
--- a/ext/rbu/rbufault3.test
+++ b/ext/rbu/rbufault3.test
@@ -13,6 +13,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/malloc_common.tcl
set ::testprefix rbufault3
diff --git a/ext/rbu/rbufault4.test b/ext/rbu/rbufault4.test
index 551b8b2b6..f4207c162 100644
--- a/ext/rbu/rbufault4.test
+++ b/ext/rbu/rbufault4.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
source $testdir/malloc_common.tcl
set ::testprefix rbufault4
diff --git a/ext/rbu/rbufts.test b/ext/rbu/rbufts.test
index 95d4e75c5..8424c9570 100644
--- a/ext/rbu/rbufts.test
+++ b/ext/rbu/rbufts.test
@@ -13,10 +13,8 @@
# contains tests to ensure that RBU works with FTS tables.
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbufts
ifcapable !fts3 {
diff --git a/ext/rbu/rbumisc.test b/ext/rbu/rbumisc.test
index c2a3906c0..6b89150bc 100644
--- a/ext/rbu/rbumisc.test
+++ b/ext/rbu/rbumisc.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbumisc
db close
diff --git a/ext/rbu/rbumulti.test b/ext/rbu/rbumulti.test
index 727d5e992..95c4fee70 100644
--- a/ext/rbu/rbumulti.test
+++ b/ext/rbu/rbumulti.test
@@ -16,6 +16,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbumulti
db close
diff --git a/ext/rbu/rbupartial.test b/ext/rbu/rbupartial.test
index d6cd7330f..c8c476a1f 100644
--- a/ext/rbu/rbupartial.test
+++ b/ext/rbu/rbupartial.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbupartial
db close
diff --git a/ext/rbu/rbupass.test b/ext/rbu/rbupass.test
index 044a3f2eb..8bebe074b 100644
--- a/ext/rbu/rbupass.test
+++ b/ext/rbu/rbupass.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbupass
if {[info commands register_demovfs]==""} {
diff --git a/ext/rbu/rbuprogress.test b/ext/rbu/rbuprogress.test
index bf37b4e50..513ccdbbe 100644
--- a/ext/rbu/rbuprogress.test
+++ b/ext/rbu/rbuprogress.test
@@ -11,6 +11,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuprogress
diff --git a/ext/rbu/rburename.test b/ext/rbu/rburename.test
index 2275396bc..fb9d83ea1 100644
--- a/ext/rbu/rburename.test
+++ b/ext/rbu/rburename.test
@@ -12,6 +12,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rburename
diff --git a/ext/rbu/rburesume.test b/ext/rbu/rburesume.test
index 82c8c66b9..fdbd21421 100644
--- a/ext/rbu/rburesume.test
+++ b/ext/rbu/rburesume.test
@@ -16,6 +16,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rburesume
forcedelete test.db-shm test.db-oal
diff --git a/ext/rbu/rbusave.test b/ext/rbu/rbusave.test
index 210d7b545..79b49de51 100644
--- a/ext/rbu/rbusave.test
+++ b/ext/rbu/rbusave.test
@@ -10,10 +10,8 @@
#***********************************************************************
#
-if {![info exists testdir]} {
- set testdir [file join [file dirname [info script]] .. .. test]
-}
-source $testdir/tester.tcl
+source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbusave
do_execsql_test 1.0 {
diff --git a/ext/rbu/rbusplit.test b/ext/rbu/rbusplit.test
index 34fef3867..b28f0c0da 100644
--- a/ext/rbu/rbusplit.test
+++ b/ext/rbu/rbusplit.test
@@ -12,6 +12,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbusplit
db close
diff --git a/ext/rbu/rbutemplimit.test b/ext/rbu/rbutemplimit.test
index 2acba3624..3ca9c64d8 100644
--- a/ext/rbu/rbutemplimit.test
+++ b/ext/rbu/rbutemplimit.test
@@ -12,6 +12,7 @@
# TESTRUNNER: slow
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbutemplimit
db close
diff --git a/ext/rbu/rbuvacuum.test b/ext/rbu/rbuvacuum.test
index 1785f529b..4ed71c266 100644
--- a/ext/rbu/rbuvacuum.test
+++ b/ext/rbu/rbuvacuum.test
@@ -15,6 +15,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set ::testprefix rbuvacuum
foreach step {0 1} {
diff --git a/ext/rbu/rbuvacuum2.test b/ext/rbu/rbuvacuum2.test
index d4f7c5232..eed8ea1ae 100644
--- a/ext/rbu/rbuvacuum2.test
+++ b/ext/rbu/rbuvacuum2.test
@@ -15,6 +15,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
foreach {step} {0 1} {
foreach {ttt state} {
diff --git a/ext/rbu/rbuvacuum3.test b/ext/rbu/rbuvacuum3.test
index 7e1e337f3..98fb25fc0 100644
--- a/ext/rbu/rbuvacuum3.test
+++ b/ext/rbu/rbuvacuum3.test
@@ -15,6 +15,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set testprefix rbuvacuum3
do_execsql_test 1.0 {
diff --git a/ext/rbu/rbuvacuum4.test b/ext/rbu/rbuvacuum4.test
index 5cf33d676..269bd2152 100644
--- a/ext/rbu/rbuvacuum4.test
+++ b/ext/rbu/rbuvacuum4.test
@@ -15,6 +15,7 @@
#
source [file join [file dirname [info script]] rbu_common.tcl]
+ifcapable !rbu { finish_test ; return }
set testprefix rbuvacuum4
set step 1
diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile
index 143ee8b9f..78e34eb19 100644
--- a/ext/wasm/GNUmakefile
+++ b/ext/wasm/GNUmakefile
@@ -66,6 +66,13 @@ ifeq (,$(emcc.version))
else
$(info using emcc version [$(emcc.version)])
endif
+emcc.version := $(shell "$(emcc.bin)" --version | sed -n 1p \
+ | sed -e 's/^.* \([3-9][^ ]*\) .*$$/\1/;')
+ifeq (,$(emcc.version))
+ $(warning Cannot determine emcc version. This might unduly impact build flags.)
+else
+ $(info using emcc version [$(emcc.version)])
+endif
wasm-strip ?= $(shell which wasm-strip 2>/dev/null)
ifeq (,$(filter clean,$(MAKECMDGOALS)))
@@ -242,9 +249,17 @@ $(2): $(1) $$(MAKEFILE) $$(bin.c-pp)
$$(bin.c-pp) -f $(1) -o $$@ $(3)
CLEAN_FILES += $(2)
endef
-c-pp.D.vanilla ?=
-c-pp.D.esm ?= -Dtarget=es6-module
-c-pp.D.bundler-friendly ?= -Dtarget=es6-module -Dtarget=es6-bundler-friendly
+c-pp.D.vanilla :=
+c-pp.D.esm := -Dtarget=es6-module
+c-pp.D.bundler-friendly := $(c-pp.D.esm) -Dtarget=es6-bundler-friendly
+# The various -D... values used by the sources include:
+#
+# -Dtarget=es6-module: intended for plain ESM module build.
+#
+# -Dtarget=es6-module -Dtarget=es6-bundler-friendly: intended for
+# "bundler-friendly" ESM module build. These have some restrictions
+# on how URL() objects are constructed in some contexts.
+#
# /end C-PP.FILTER
########################################################################
diff --git a/ext/wasm/api/extern-post-js.c-pp.js b/ext/wasm/api/extern-post-js.c-pp.js
index 691ad7685..a577a63e1 100644
--- a/ext/wasm/api/extern-post-js.c-pp.js
+++ b/ext/wasm/api/extern-post-js.c-pp.js
@@ -9,7 +9,7 @@
Emscripten-generated module init scope, in the current
global scope. */
//#if target=es6-module
-const toExportForES6 =
+const toExportForESM =
//#endif
(function(){
/**
@@ -45,23 +45,14 @@ const toExportForES6 =
moduleScript: self?.document?.currentScript,
isWorker: ('undefined' !== typeof WorkerGlobalScope),
location: self.location,
- urlParams:
-//#if target=es6-bundler-friendly
- undefined
-//#else
- new URL(self.location.href).searchParams
-//#endif
+ urlParams: new URL(self.location.href).searchParams
});
initModuleState.debugModule =
-//#if target=es6-bundler-friendly
- ()=>{}
-//#else
- (new URL(self.location.href).searchParams).has('sqlite3.debugModule')
+ initModuleState.urlParams.has('sqlite3.debugModule')
? (...args)=>console.warn('sqlite3.debugModule:',...args)
: ()=>{};
-//#endif
- if(initModuleState.urlParams && initModuleState.urlParams.has('sqlite3.dir')){
+ if(initModuleState.urlParams.has('sqlite3.dir')){
initModuleState.sqlite3Dir = initModuleState.urlParams.get('sqlite3.dir') +'/';
}else if(initModuleState.moduleScript){
const li = initModuleState.moduleScript.src.split('/');
@@ -116,8 +107,8 @@ const toExportForES6 =
}
//#ifnot target=es6-module
// Emscripten does not inject these module-loader bits in ES6 module
-// build and including them here breaks JS bundlers, so elide them
-// from ES6 builds.
+// builds and including them here breaks JS bundlers, so elide them
+// from ESM builds.
/* Replace the various module exports performed by the Emscripten
glue... */
if (typeof exports === 'object' && typeof module === 'object'){
@@ -131,5 +122,5 @@ const toExportForES6 =
return self.sqlite3InitModule /* required for ESM */;
})();
//#if target=es6-module
-export default toExportForES6;
+export default toExportForESM;
//#endif
diff --git a/ext/wasm/api/pre-js.c-pp.js b/ext/wasm/api/pre-js.c-pp.js
index c27c2fe0d..a25c7ce77 100644
--- a/ext/wasm/api/pre-js.c-pp.js
+++ b/ext/wasm/api/pre-js.c-pp.js
@@ -55,9 +55,9 @@ Module['locateFile'] = function(path, prefix) {
"result =", theFile
);
return theFile;
-//#endif //target=es6-module
+//#endif target=es6-module
}.bind(sqlite3InitModuleState);
-//#endif //ifnot target=es6-bundler-friendly
+//#endif ifnot target=es6-bundler-friendly
/**
Bug warning: a custom Module.instantiateWasm() does not work
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index aeda62aa2..451f0019c 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -100,20 +100,13 @@ const installOpfsVfs = function callee(options){
if(!options || 'object'!==typeof options){
options = Object.create(null);
}
- const urlParams =
-//#if target=es6-bundler-friendly
- undefined;
-//#else
- new URL(self.location.href).searchParams;
-//#endif
- if(urlParams){
- if(undefined===options.verbose){
- options.verbose = urlParams.has('opfs-verbose')
- ? (+urlParams.get('opfs-verbose') || 2) : 1;
- }
- if(undefined===options.sanityChecks){
- options.sanityChecks = urlParams.has('opfs-sanity-check');
- }
+ const urlParams = new URL(self.location.href).searchParams;
+ if(undefined===options.verbose){
+ options.verbose = urlParams.has('opfs-verbose')
+ ? (+urlParams.get('opfs-verbose') || 2) : 1;
+ }
+ if(undefined===options.sanityChecks){
+ options.sanityChecks = urlParams.has('opfs-sanity-check');
}
if(undefined===options.proxyUri){
options.proxyUri = callee.defaultProxyUri;
diff --git a/ext/wasm/tester1-worker.html b/ext/wasm/tester1-worker.html
index a9c12d72c..03e1f02b0 100644
--- a/ext/wasm/tester1-worker.html
+++ b/ext/wasm/tester1-worker.html
@@ -11,8 +11,12 @@
</head>
<body>
<h1 id='color-target'>sqlite3 tester #1: Worker thread</h1>
- <div>See <a href='tester1.html' target='tester1.html'>tester1.html</a>
- for the UI-thread variant.</div>
+ <div>Variants:
+ <a href='tester1.html' target='tester1.html'>conventional UI thread</a>,
+ <a href='tester1-worker.html' target='tester1-worker.html'>conventional worker</a>,
+ <a href='tester1-esm.html' target='tester1-esm.html'>ESM in UI thread</a>,
+ <a href='tester1-worker.html?esm' target='tester1-worker.html?esm'>ESM worker</a>
+ </div>
<div class='input-wrapper'>
<input type='checkbox' id='cb-log-reverse'>
<label for='cb-log-reverse'>Reverse log order?</label>
diff --git a/ext/wasm/tester1.c-pp.html b/ext/wasm/tester1.c-pp.html
index 535e58962..bbdd8b223 100644
--- a/ext/wasm/tester1.c-pp.html
+++ b/ext/wasm/tester1.c-pp.html
@@ -16,8 +16,12 @@ UI thread
<style></style>
</head>
<body><h1 id='color-target'></h1>
- <div>See <a href='tester1-worker.html' target='tester1-worker.html'>tester1-worker.html</a>
- for the Worker-thread variant.</div>
+ <div>Variants:
+ <a href='tester1.html' target='tester1.html'>conventional UI thread</a>,
+ <a href='tester1-worker.html' target='tester1-worker.html'>conventional worker</a>,
+ <a href='tester1-esm.html' target='tester1-esm.html'>ESM in UI thread</a>,
+ <a href='tester1-worker.html?esm' target='tester1-worker.html?esm'>ESM worker</a>
+ </div>
<div class='input-wrapper'>
<input type='checkbox' id='cb-log-reverse'>
<label for='cb-log-reverse'>Reverse log order?</label>
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js
index 7f5de5166..dca533137 100644
--- a/ext/wasm/tester1.c-pp.js
+++ b/ext/wasm/tester1.c-pp.js
@@ -1192,13 +1192,13 @@ self.sqlite3InitModule = sqlite3InitModule;
rc = capi.sqlite3_db_status(this.db, capi.SQLITE_DBSTATUS_LOOKASIDE_USED,
pCur, pHi, 0);
T.assert(0===rc);
- if(wasm.peek32(pCur)){
- warn("Cannot test db_config(SQLITE_DBCONFIG_LOOKASIDE)",
- "while lookaside memory is in use.");
- }else{
+ if(!wasm.peek32(pCur)){
rc = capi.sqlite3_db_config(this.db, capi.SQLITE_DBCONFIG_LOOKASIDE,
0, 4096, 12);
T.assert(0 === rc);
+ }else{
+ console.debug("Cannot test db_config(SQLITE_DBCONFIG_LOOKASIDE)",
+ "while lookaside memory is in use.");
}
wasm.poke32([pCur, pHi], 0);
let [vCur, vHi] = wasm.peek32(pCur, pHi);