mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Change the testfixture binary so that it explicitly enabled core files
on a crash (on unix). Add a test case to verify that this works. FossilOrigin-Name: 90f422ed81311d7ab2a90a381d36cba9c20227fc
This commit is contained in:
@ -3813,6 +3813,11 @@ static void init_all(Tcl_Interp *interp){
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Needed for the setrlimit() system call on unix */
|
||||
#if defined(unix)
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#define TCLSH_MAIN main /* Needed to fake out mktclapp */
|
||||
int TCLSH_MAIN(int argc, char **argv){
|
||||
Tcl_Interp *interp;
|
||||
@ -3826,6 +3831,17 @@ int TCLSH_MAIN(int argc, char **argv){
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Since the primary use case for this binary is testing of SQLite,
|
||||
** be sure to generate core files if we crash */
|
||||
#if defined(SQLITE_TEST) && defined(unix)
|
||||
{ struct rlimit x;
|
||||
getrlimit(RLIMIT_CORE, &x);
|
||||
x.rlim_cur = x.rlim_max;
|
||||
setrlimit(RLIMIT_CORE, &x);
|
||||
}
|
||||
#endif /* SQLITE_TEST && unix */
|
||||
|
||||
|
||||
/* Call sqlite3_shutdown() once before doing anything else. This is to
|
||||
** test that sqlite3_shutdown() can be safely called by a process before
|
||||
** sqlite3_initialize() is. */
|
||||
|
Reference in New Issue
Block a user