SQLite

Check-in [50b5a8af84]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Try to fix up the "valgrindtest" target in Makefile.in so that it avoids misuse testing that can trigger false errors.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 50b5a8af843fff93452cd1c8f82152124a1d864a
User & Date: drh 2015-01-08 16:47:51.547
Context
2015-01-08
22:08
Omit modules from the "valgrind" permutation that fork off separate processes. Also omit selectG.test because it is timing sensitive and valgrind is too slow to get the right answer. (check-in: 662932a69a user: drh tags: trunk)
20:06
Merge recent enhancements from trunk, including test scripts enhancements and the removal of limits on the number of terms in a VALUES clause. (check-in: 5a2dec55bf user: drh tags: sessions)
19:55
Merge the testing enhancements and the unlimited VALUES enhancement from trunk. (check-in: cc7808427f user: drh tags: apple-osx)
16:47
Try to fix up the "valgrindtest" target in Makefile.in so that it avoids misuse testing that can trigger false errors. (check-in: 50b5a8af84 user: drh tags: trunk)
02:28
Fix the extension tags on the "smoketest" makefile target for Windows. (check-in: 826fd311e7 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to Makefile.in.
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
test:	testfixture$(TEXE) sqlite3$(TEXE)
	./testfixture$(TEXE) $(TOP)/test/veryquick.test

# Run a test using valgrind.  This can take a really long time
# because valgrind is so much slower than a native machine.
#
valgrindtest:	testfixture$(TEXE) sqlite3$(TEXE)
	valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind

# A very fast test that checks basic sanity.  The name comes from
# the 60s-era electronics testing:  "Turn it on and see if smoke
# comes out."
#
smoketest:	testfixture$(TEXE)
	./testfixture$(TEXE) $(TOP)/test/main.test







|







948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
test:	testfixture$(TEXE) sqlite3$(TEXE)
	./testfixture$(TEXE) $(TOP)/test/veryquick.test

# Run a test using valgrind.  This can take a really long time
# because valgrind is so much slower than a native machine.
#
valgrindtest:	testfixture$(TEXE) sqlite3$(TEXE)
	OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind

# A very fast test that checks basic sanity.  The name comes from
# the 60s-era electronics testing:  "Turn it on and see if smoke
# comes out."
#
smoketest:	testfixture$(TEXE)
	./testfixture$(TEXE) $(TOP)/test/main.test
Changes to src/test1.c.
257
258
259
260
261
262
263


264
265
266
267
268
269
270
271
272
273
274
275
276

277
278
279
280
281
282
283
}

/*
** Usage:  clang_sanitize_address 
**
** Returns true if the program was compiled using clang with the 
** -fsanitize=address switch on the command line. False otherwise.


*/
static int clang_sanitize_address(
  void *NotUsed,
  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
  int argc,              /* Number of arguments */
  char **argv            /* Text of each argument */
){
  int res = 0;
#if defined(__has_feature)
# if __has_feature(address_sanitizer)
  res = 1;
# endif
#endif

  Tcl_SetObjResult(interp, Tcl_NewIntObj(res));
  return TCL_OK;
}
  
/*
** Usage:  sqlite3_exec_printf  DB  FORMAT  STRING
**







>
>













>







257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
}

/*
** Usage:  clang_sanitize_address 
**
** Returns true if the program was compiled using clang with the 
** -fsanitize=address switch on the command line. False otherwise.
**
** Also return true if the OMIT_MISUSE environment variable exists.
*/
static int clang_sanitize_address(
  void *NotUsed,
  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
  int argc,              /* Number of arguments */
  char **argv            /* Text of each argument */
){
  int res = 0;
#if defined(__has_feature)
# if __has_feature(address_sanitizer)
  res = 1;
# endif
#endif
  if( res==0 && getenv("OMIT_MISUSE")!=0 ) res = 1;
  Tcl_SetObjResult(interp, Tcl_NewIntObj(res));
  return TCL_OK;
}
  
/*
** Usage:  sqlite3_exec_printf  DB  FORMAT  STRING
**
Changes to test/oserror.test.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
# Test a failure in open() due to too many files. 
#
# The xOpen() method of the unix VFS calls getcwd() as well as open().
# Although this does not appear to be documented in the man page, on OSX
# a call to getcwd() may fail if there are no free file descriptors. So
# an error may be reported for either open() or getcwd() here.
#
puts "Possible valgrind error about invalid file descriptor follows:"
do_test 1.1.1 {
  set ::log [list]
  list [catch {
    for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
  } msg] $msg
} {1 {unable to open database file}}
do_test 1.1.2 {
  catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } }
} {1}
do_re_test 1.1.3 { 
  lindex $::log 0 
} {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - }



# Test a failure in open() due to the path being a directory.
#
do_test 1.2.1 {
  file mkdir dir.db
  set ::log [list]







|
|
|
|
|
|
|
|
|
|
|
|
|
>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Test a failure in open() due to too many files. 
#
# The xOpen() method of the unix VFS calls getcwd() as well as open().
# Although this does not appear to be documented in the man page, on OSX
# a call to getcwd() may fail if there are no free file descriptors. So
# an error may be reported for either open() or getcwd() here.
#
if {![clang_sanitize_address]} {
  do_test 1.1.1 {
    set ::log [list]
    list [catch {
      for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
    } msg] $msg
  } {1 {unable to open database file}}
  do_test 1.1.2 {
    catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } }
  } {1}
  do_re_test 1.1.3 { 
    lindex $::log 0 
  } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - }
}


# Test a failure in open() due to the path being a directory.
#
do_test 1.2.1 {
  file mkdir dir.db
  set ::log [list]