1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix Makefile.in to account for recent changes. Update fts5 test scripts so that they do not run if SQLITE_ENABLE_FTS5 is not defined.

FossilOrigin-Name: 3175220747f5d4dadd17e09fb1899dc782c90926
This commit is contained in:
dan
2015-06-25 20:36:36 +00:00
parent f32fa3116b
commit 3e65f89ef6
37 changed files with 268 additions and 58 deletions

View File

@@ -15,6 +15,7 @@ if {![info exists testdir]} {
}
source $testdir/tester.tcl
catch { sqlite3_fts5_may_be_corrupt 0 }
proc fts5_test_poslist {cmd} {

View File

@@ -16,6 +16,11 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5alter
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# Test renaming regular, contentless and columnsize=0 FTS5 tables.

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5aux
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
proc inst {cmd i} {
$cmd xInst $i
}

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5auxdata
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE f1 USING fts5(a, b);
INSERT INTO f1(rowid, a, b) VALUES(1, 'a', 'b1');

View File

@@ -17,6 +17,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5bigpl
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
if { $tcl_platform(wordSize)<8 } {
finish_test
return

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5columnsize
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# Check that the option can be parsed and that the %_docsize table is
# only created if it is set to true.

View File

@@ -16,6 +16,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5config
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# Try different types of quote characters.
#

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5content
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# Contentless tables
#

View File

@@ -16,6 +16,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5corrupt
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE t1 USING fts5(x);
INSERT INTO t1(t1, rank) VALUES('pgsz', 32);

View File

@@ -16,6 +16,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5corrupt2
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
sqlite3_fts5_may_be_corrupt 1
# Create a simple FTS5 table containing 100 documents. Each document

View File

@@ -16,6 +16,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5corrupt3
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
sqlite3_fts5_may_be_corrupt 1
# Create a simple FTS5 table containing 100 documents. Each document

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5dlidx
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
if { $tcl_platform(wordSize)<8 } {
finish_test
return

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5doclist
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# Create a table with 1000 columns. Then add some large documents to it.

View File

@@ -17,6 +17,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5full
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE x8 USING fts5(i);
INSERT INTO x8(x8, rank) VALUES('automerge', 0);

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5hash
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# Return a list of tokens (a vocabulary) that all share the same hash
# key value. This can be used to test hash collisions.

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5integrity
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE xx USING fts5(x);
INSERT INTO xx VALUES('term');

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5merge
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
db func repeat [list string repeat]
#-------------------------------------------------------------------------

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5near
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
proc do_near_test {tn doc near res} {
uplevel [list do_execsql_test $tn "
DELETE FROM t1;

View File

@@ -14,6 +14,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5optimize
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
proc rnddoc {nWord} {
set vocab {a b c d e f g h i j k l m n o p q r s t u v w x y z}
set nVocab [llength $vocab]

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5plan
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE TABLE t1(x, y);
CREATE VIRTUAL TABLE f1 USING fts5(ff);

View File

@@ -17,6 +17,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5porter
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
set test_vocab {
a a aaron aaron
abaissiez abaissiez abandon abandon

View File

@@ -18,6 +18,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5porter2
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
set test_vocab {
tion tion
ation ation

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5prefix
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE xx USING fts5(x, prefix=1);
INSERT INTO xx VALUES('one two three');

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5rank
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
#-------------------------------------------------------------------------
# "ORDER BY rank" + highlight() + large poslists.

View File

@@ -14,6 +14,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5rebuild
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.1 {
CREATE VIRTUAL TABLE f1 USING fts5(a, b);
INSERT INTO f1(a, b) VALUES('one', 'o n e');

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5restart
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE f1 USING fts5(ff);
}

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5rowid
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_catchsql_test 1.1 {
SELECT fts5_rowid()
} {1 {should be: fts5_rowid(subject, ....)}}

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5tokenizer
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE ft1 USING fts5(x, tokenize=porter);

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5unicode
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
proc tokenize_test {tn tokenizer input output} {
uplevel [list do_test $tn [subst -nocommands {
set ret {}

View File

@@ -17,6 +17,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5unicode2
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
proc do_unicode_token_test {tn input res} {
uplevel [list do_test $tn [list \
sqlite3_fts5_tokenize -subst db "unicode61 remove_diacritics 0" $input

View File

@@ -12,11 +12,18 @@
# Tests focusing on the fts5 tokenizers
#
source [file join [file dirname [info script]] fts5_common.tcl]
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
proc fts3_unicode_path {file} {
file join [file dirname [info script]] .. .. fts3 unicode $file
}
source [file join [file dirname [info script]] fts5_common.tcl]
source [fts3_unicode_path parseunicode.tcl]
set testprefix fts5unicode3

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5unindexed
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.1 {
CREATE VIRTUAL TABLE t1 USING fts5(a, b UNINDEXED);

View File

@@ -16,6 +16,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5version
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.1 {
CREATE VIRTUAL TABLE t1 USING fts5(one);

View File

@@ -15,6 +15,12 @@
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5vocab
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
do_execsql_test 1.1.1 {
CREATE VIRTUAL TABLE t1 USING fts5(one, prefix=1);