aboutsummaryrefslogtreecommitdiff
path: root/test/fuzzcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/fuzzcheck.c')
-rw-r--r--test/fuzzcheck.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/test/fuzzcheck.c b/test/fuzzcheck.c
index 6dc2a6e7f..f637e6463 100644
--- a/test/fuzzcheck.c
+++ b/test/fuzzcheck.c
@@ -10,8 +10,8 @@
**
*************************************************************************
**
-** This is a utility program designed to aid running regressions tests
-** on SQLite library using data from an external fuzzer, such as American
+** This is a utility program designed to aid running regressions tests on
+** the SQLite library using data from an external fuzzer, such as American
** Fuzzy Lop (AFL) (http://lcamtuf.coredump.cx/afl/).
**
** This program reads content from an SQLite database file with the following
@@ -25,16 +25,44 @@
** sqlid INTEGER PRIMARY KEY, -- SQL script id
** sqltext TEXT -- Text of SQL statements to run
** );
+** CREATE TABLE IF NOT EXISTS readme(
+** msg TEXT -- Human-readable description of this test collection
+** );
**
** For each database file in the DB table, the SQL text in the XSQL table
-** is run against that database. This program is looking for crashes,
-** assertion faults, and/or memory leaks. No attempt is made to verify
-** the output. The assumption is that either all of the database files
-** or all of the SQL statements are malformed inputs, generated by a fuzzer,
-** that need to be checked to make sure they do not present a security risk.
+** is run against that database. All README.MSG values are printed prior
+** to the start of the test (unless the --quiet option is used). If the
+** DB table is empty, then all entries in XSQL are run against an empty
+** in-memory database.
+**
+** This program is looking for crashes, assertion faults, and/or memory leaks.
+** No attempt is made to verify the output. The assumption is that either all
+** of the database files or all of the SQL statements are malformed inputs,
+** generated by a fuzzer, that need to be checked to make sure they do not
+** present a security risk.
**
** This program also includes some command-line options to help with
-** creation and maintenance of the source content database.
+** creation and maintenance of the source content database. The command
+**
+** ./fuzzcheck database.db --load-sql FILE...
+**
+** Loads all FILE... arguments into the XSQL table. The --load-db option
+** works the same but loads the files into the DB table. The -m option can
+** be used to initialize the README table. The "database.db" file is created
+** if it does not previously exist. Example:
+**
+** ./fuzzcheck new.db --load-sql *.sql
+** ./fuzzcheck new.db --load-db *.db
+** ./fuzzcheck new.db -m 'New test cases'
+**
+** The three commands above will create the "new.db" file and initialize all
+** tables. Then do "./fuzzcheck new.db" to run the tests.
+**
+** DEBUGGING HINTS:
+**
+** If fuzzcheck does crash, it can be run in the debugger and the content
+** of the global variable g.zTextName[] will identify the specific XSQL and
+** DB values that were running when the crash occurred.
*/
#include <stdio.h>
#include <stdlib.h>