mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Add support for measuring and reporting coverage of the parser state machine
using the SQLITE_TESTCTRL_PARSER_COVERAGE test-control. FossilOrigin-Name: 1253a872dbf48656d4efd588ab61223a5ac550d9b2b932249d6ba585276ba573
This commit is contained in:
16
src/main.c
16
src/main.c
@@ -3911,6 +3911,22 @@ int sqlite3_test_control(int op, ...){
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(YYCOVERAGE)
|
||||
/* sqlite3_test_control(SQLITE_TESTCTRL_PARSER_COVERAGE, FILE *out)
|
||||
**
|
||||
** This test control (only available when SQLite is compiled with
|
||||
** -DYYCOVERAGE) writes a report onto "out" that shows all
|
||||
** state/lookahead combinations in the parser state machine
|
||||
** which are never exercised. If any state is missed, make the
|
||||
** return code SQLITE_ERROR.
|
||||
*/
|
||||
case SQLITE_TESTCTRL_PARSER_COVERAGE: {
|
||||
FILE *out = va_arg(ap, FILE*);
|
||||
if( sqlite3ParserCoverage(out) ) rc = SQLITE_ERROR;
|
||||
break;
|
||||
}
|
||||
#endif /* defined(YYCOVERAGE) */
|
||||
}
|
||||
va_end(ap);
|
||||
#endif /* SQLITE_UNTESTABLE */
|
||||
|
Reference in New Issue
Block a user