System.Data.SQLite

Check-in [bed252ba0c]
Login

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

Overview
Comment:Update Eagle in externals to the latest trunk. Always specify the stack size for threads created by the test suite. Allow the SQLite temporary directory used by the test suite to be easily overridden.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bed252ba0c8c039bd6061e805e45c739e07e9427
User & Date: mistachkin 2012-10-07 03:41:57.534
Context
2012-10-08
09:11
Add support for extra diagnostics in the native interop assembly when compiled in the debug build configuration. Fix several tests to account for recent changes to the setupDb and cleanupDb test suite infrastructure procedures. check-in: e8a0cf1336 user: mistachkin tags: trunk
2012-10-07
03:41
Update Eagle in externals to the latest trunk. Always specify the stack size for threads created by the test suite. Allow the SQLite temporary directory used by the test suite to be easily overridden. check-in: bed252ba0c user: mistachkin tags: trunk
02:04
Add garbage collection workload to the stress test and centralize the garbage collection logic in the test suite infrastructure. check-in: 81b6f97b42 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Externals/Eagle/bin/Eagle.dll.

cannot compute difference between binary files

Changes to Externals/Eagle/bin/EagleShell.exe.

cannot compute difference between binary files

Changes to Externals/Eagle/lib/Eagle1.0/vendor.eagle.
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
    #
    # NOTE: Check for any overridden settings that may have been specified via
    #       the command line, etc.
    #
    checkForTestOverrides stdout [list binary_directory build_base_directory \
        build_directory common_directory connection_flags database_directory \
        datetime_format test_configuration test_year test_year_clr_v2 \
        test_year_clr_v4 vendor_directory] false

    #
    # NOTE: This variable will contain the name of the directory containing the
    #       vendor-specific testing infrastructure.  If the variable does not
    #       already exist, create it; otherwise, it has been overridden and the
    #       existing value should be left intact.
    #







|







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
    #
    # NOTE: Check for any overridden settings that may have been specified via
    #       the command line, etc.
    #
    checkForTestOverrides stdout [list binary_directory build_base_directory \
        build_directory common_directory connection_flags database_directory \
        datetime_format test_configuration test_year test_year_clr_v2 \
        temporary_directory test_year_clr_v4 vendor_directory] false

    #
    # NOTE: This variable will contain the name of the directory containing the
    #       vendor-specific testing infrastructure.  If the variable does not
    #       already exist, create it; otherwise, it has been overridden and the
    #       existing value should be left intact.
    #
Changes to Externals/Eagle/lib/Test1.0/epilogue.eagle.
14
15
16
17
18
19
20

















21
22
23
24
25
26
27
#
###############################################################################

if {![info exists no([file tail [info script]])]} then {
  if {[info level] > 0} then {
    error "cannot run, current level is not global"
  }


















  #
  # NOTE: Make sure all the variables used by this epilogue are unset.
  #
  unset -nocomplain memory stack name count passedOrSkipped percent \
      exitCode








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
###############################################################################

if {![info exists no([file tail [info script]])]} then {
  if {[info level] > 0} then {
    error "cannot run, current level is not global"
  }

  #
  # NOTE: Verify that the current call frame is correct and that the
  #       interpreter call stack has not been imbalanced by previous
  #       tests or other errors.  This check only applies to Eagle.
  #
  if {[isEagle]} then {
    #
    # NOTE: Check the name of the current call frame against the one
    #       that should be used for evaluating this script file.
    #
    if {[object invoke -flags +NonPublic \
            Interpreter.GetActive.CurrentFrame Name] ne \
        [appendArgs source " " [file normalize [info script]]]} then {
      error "cannot run, current frame is not for this script"
    }
  }

  #
  # NOTE: Make sure all the variables used by this epilogue are unset.
  #
  unset -nocomplain memory stack name count passedOrSkipped percent \
      exitCode

Changes to Externals/Eagle/lib/Test1.0/prologue.eagle.
76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

    unset pkg_dir
  }

  #############################################################################

  #
  # NOTE: Set the local root directory of the source checkout (i.e. of Eagle or
  #       whatever project the Eagle binaries are being used by).

  #
  if {![info exists root_path] && ![info exists no(fossil)]} then {
    set pattern {^local-root:\s+(.*?)\s+$}

    if {[catch {set exec [exec -- fossil info]}] || \
        [regexp -line -- $pattern $exec dummy directory] == 0} then {
      #
      # NOTE: We could not query local root directory of the source checkout
      #       from Fossil; therefore, attempt to make an educated guess.  This
      #       value will probably be wrong for any project(s) other than Eagle.
      #       In that case, this value should be overridden by that project to
      #       relfect the actual local root directory of the source checkout
      #       for that project.
      #
      set root_path $base_path
    } else {
      #
      # NOTE: We extracted the local root directory of the source checkout
      #       from Fossil.  Now, make sure it is fully normalized and has no







|
|
>











|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

    unset pkg_dir
  }

  #############################################################################

  #
  # NOTE: Set the local root directory of the source checkout (i.e. of Eagle
  #       or whatever project the Eagle binaries are being used by) using a
  #       Fossil binary in the PATH, if available.
  #
  if {![info exists root_path] && ![info exists no(fossil)]} then {
    set pattern {^local-root:\s+(.*?)\s+$}

    if {[catch {set exec [exec -- fossil info]}] || \
        [regexp -line -- $pattern $exec dummy directory] == 0} then {
      #
      # NOTE: We could not query local root directory of the source checkout
      #       from Fossil; therefore, attempt to make an educated guess.  This
      #       value will probably be wrong for any project(s) other than Eagle.
      #       In that case, this value should be overridden by that project to
      #       reflect the actual local root directory of the source checkout
      #       for that project.
      #
      set root_path $base_path
    } else {
      #
      # NOTE: We extracted the local root directory of the source checkout
      #       from Fossil.  Now, make sure it is fully normalized and has no
210
211
212
213
214
215
216



















217
218
219
220
221
222
223
  #
  # NOTE: Check for and load the Eagle test constraints package, if
  #       necessary.
  #
  if {[catch {package present Eagle.Test.Constraints}]} then {
    package require Eagle.Test.Constraints
  }




















  #############################################################################

  #
  # NOTE: If command line arguments were supplied, process them now.
  #
  set test_flags(-configuration) ""; # build configuration, default to empty.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
  #
  # NOTE: Check for and load the Eagle test constraints package, if
  #       necessary.
  #
  if {[catch {package present Eagle.Test.Constraints}]} then {
    package require Eagle.Test.Constraints
  }

  #############################################################################

  #
  # NOTE: Verify that the current call frame is correct and that the
  #       interpreter call stack has not been imbalanced by previous
  #       tests or other errors.  This check only applies to Eagle.
  #
  if {[isEagle]} then {
    #
    # NOTE: Check the name of the current call frame against the one
    #       that should be used for evaluating this script file.
    #
    if {[object invoke -flags +NonPublic \
            Interpreter.GetActive.CurrentFrame Name] ne \
        [appendArgs source " " [file normalize [info script]]]} then {
      error "cannot run, current frame is not for this script"
    }
  }

  #############################################################################

  #
  # NOTE: If command line arguments were supplied, process them now.
  #
  set test_flags(-configuration) ""; # build configuration, default to empty.
1127
1128
1129
1130
1131
1132
1133






1134
1135
1136
1137
1138
1139
1140
        # NOTE: For tests "function-5.*".
        #
        checkForObjectMember $test_channel Eagle._Tests.Default \
            *TestAddNamedFunction*

        checkForObjectMember $test_channel Eagle._Tests.Default \
            *TestRemoveNamedFunction*






      }

      #
      # NOTE: Has write-box testing support been disabled?
      #
      if {![info exists no(testWriteBox)]} then {
        #







>
>
>
>
>
>







1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
        # NOTE: For tests "function-5.*".
        #
        checkForObjectMember $test_channel Eagle._Tests.Default \
            *TestAddNamedFunction*

        checkForObjectMember $test_channel Eagle._Tests.Default \
            *TestRemoveNamedFunction*

        #
        # NOTE: For test "interp-1.18".
        #
        checkForObjectMember $test_channel Eagle._Tests.Default \
            *TestAddNamedFunction2*
      }

      #
      # NOTE: Has write-box testing support been disabled?
      #
      if {![info exists no(testWriteBox)]} then {
        #
2006
2007
2008
2009
2010
2011
2012
2013
2014

2015
2016

2017
2018
2019
2020
2021
2022
2023
2024
















2025
2026
2027
2028
2029
2030
2031
2032

2033
2034
2035
2036
2037



2038
2039
2040
2041
2042
2043
2044
2045

  #
  # NOTE: For Eagle, dump the platform information, including
  #       the compile options.
  #
  if {[isEagle]} then {
    #
    # NOTE: Get the source checkout (i.e. of Eagle or whatever project the
    #       Eagle binaries are being used by).

    #
    if {![info exists no(fossil)]} then {

      set pattern {^checkout:\s+(.*?)\s+$}

      if {[catch {set exec [exec -- fossil info]}] || \
          [regexp -line -- $pattern $exec dummy checkout] == 0} then {
        #
        # NOTE: We could not query the source checkout from Fossil.
        #
        set checkout <none>
















      }

      unset -nocomplain dummy exec pattern
    } else {
      #
      # NOTE: Querying the source checkout from Fossil was disabled.
      #
      set checkout <none>

    }

    tputs $test_channel [appendArgs "---- checkout: " \
        $checkout \n]




    unset checkout

    ###########################################################################

    set timeStamp [getPlatformInfo timeStamp ""]

    if {[string length $timeStamp] > 0} then {
      #########################################################################







|
|
>


>
|

<
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>





>
>
>
|







2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046

2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092

  #
  # NOTE: For Eagle, dump the platform information, including
  #       the compile options.
  #
  if {[isEagle]} then {
    #
    # NOTE: Get the source checkout and tags (i.e. of Eagle or whatever
    #       project the Eagle binaries are being used by) using a Fossil
    #       binary in the PATH, if available.
    #
    if {![info exists no(fossil)]} then {
      if {[catch {set exec [exec -- fossil info]}] == 0} then {
        set pattern {^checkout:\s+(.*?)\s+$}


        if {[regexp -line -- $pattern $exec dummy checkout] == 0} then {
          #
          # NOTE: We could not query the source checkout from Fossil.
          #
          set checkout <none>
        }

        set pattern {^tags:\s+(.*?)\s+$}

        if {[regexp -line -- $pattern $exec dummy tags] == 0} then {
          #
          # NOTE: We could not query the tags from Fossil.
          #
          set tags <none>
        }
      } else {
        #
        # NOTE: We could not query information from Fossil.
        #
        set checkout <none>
        set tags <none>
      }

      unset -nocomplain dummy exec pattern
    } else {
      #
      # NOTE: Querying the source checkout from Fossil was disabled.
      #
      set checkout <none>
      set tags <none>
    }

    tputs $test_channel [appendArgs "---- checkout: " \
        $checkout \n]

    tputs $test_channel [appendArgs "---- tags: " \
        $tags \n]

    unset tags checkout

    ###########################################################################

    set timeStamp [getPlatformInfo timeStamp ""]

    if {[string length $timeStamp] > 0} then {
      #########################################################################
Changes to Tests/common.eagle.
309
310
311
312
313
314
315


















316
317
318
319
320
321
322
        #       therefore, use it.
        #
        return [file normalize $::database_directory]
      } else {
        return [getTemporaryPath]
      }
    }



















    proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
      #
      # NOTE: This procedure returns a test setup script suitable for evaluation
      #       by a test interpreter created in an isolated application domain.
      #       The script being returned will be surrounded by the prefix and
      #       suffix "script fragments" specified by our caller, if any.  The







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
        #       therefore, use it.
        #
        return [file normalize $::database_directory]
      } else {
        return [getTemporaryPath]
      }
    }

    proc getTemporaryDirectory {} {
      #
      # NOTE: This procedure returns the directory where the temporary files
      #       should be located.  By default, this just uses the temporary
      #       directory configured for this system.
      #
      if {[info exists ::temporary_directory] && \
          [string length $::temporary_directory] > 0} then {
        #
        # NOTE: The location of the temporary directory has been overridden;
        #       therefore, use it.
        #
        return [file normalize $::temporary_directory]
      } else {
        return [getTemporaryPath]
      }
    }

    proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
      #
      # NOTE: This procedure returns a test setup script suitable for evaluation
      #       by a test interpreter created in an isolated application domain.
      #       The script being returned will be surrounded by the prefix and
      #       suffix "script fragments" specified by our caller, if any.  The
739
740
741
742
743
744
745







746
747
748
749
750
751
752
      }

      #
      # NOTE: Open the database connection now, placing the opaque handle value
      #       into the variable specified by our caller.
      #
      set db [sql open -type SQLite [subst $connection]]







    }

    proc getDbConnection { {varName db} } {
      #
      # NOTE: Refer to the specified variable (e.g. "db") in the context of our
      #       caller.  The handle to the database previously opened by [setupDb]
      #       should be stored there.







>
>
>
>
>
>
>







757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
      }

      #
      # NOTE: Open the database connection now, placing the opaque handle value
      #       into the variable specified by our caller.
      #
      set db [sql open -type SQLite [subst $connection]]

      #
      # NOTE: Configure the temporary directory for the newly opened database
      #       connection now.
      #
      sql execute $db [appendArgs \
          "PRAGMA temp_store_directory = \"" [getTemporaryDirectory] "\";"]
    }

    proc getDbConnection { {varName db} } {
      #
      # NOTE: Refer to the specified variable (e.g. "db") in the context of our
      #       caller.  The handle to the database previously opened by [setupDb]
      #       should be stored there.
Changes to Tests/stress.eagle.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  set count(0) 1
  set count(1) 5
  set count(2) 300
  set noWorkload [list]

  if {[info exists argv] && [llength $argv] > 0} then {
    parse options -flags \
        {-StopOnUnknown +IgnoreOnUnknown SkipOnUnknown} -- [list \
        [list null MustHaveIntegerValue -1 -1 -count0 $count(0)] \
        [list null MustHaveIntegerValue -1 -1 -count1 $count(1)] \
        [list null MustHaveIntegerValue -1 -1 -count2 $count(2)] \
        [list null MustHaveListValue -1 -1 -noWorkload $noWorkload]] $argv

    set count(0) $options(-count0,value)
    set count(1) $options(-count1,value)
    set count(2) $options(-count2,value)







|
|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  set count(0) 1
  set count(1) 5
  set count(2) 300
  set noWorkload [list]

  if {[info exists argv] && [llength $argv] > 0} then {
    parse options -flags \
        {-StopOnUnknownOption +IgnoreOnUnknownOption SkipOnUnknownOption} -- \
        [list [list null MustHaveIntegerValue -1 -1 -count0 $count(0)] \
        [list null MustHaveIntegerValue -1 -1 -count1 $count(1)] \
        [list null MustHaveIntegerValue -1 -1 -count2 $count(2)] \
        [list null MustHaveListValue -1 -1 -noWorkload $noWorkload]] $argv

    set count(0) $options(-count0,value)
    set count(1) $options(-count1,value)
    set count(2) $options(-count2,value)
89
90
91
92
93
94
95



96






97

98
99
100
101
102
103
104
  #############################################################################

  set compiled(12) ""
  set compiled(13) ""

  #############################################################################




  set fileName(1) "file::memory:?cache=shared"






  set fileName(2) [file join [getDatabaseDirectory] stress.db]


  #############################################################################

  #
  # NOTE: Make sure to remove any stale database from previous test runs.
  #
  cleanupFile $fileName(2)







>
>
>

>
>
>
>
>
>
|
>







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  #############################################################################

  set compiled(12) ""
  set compiled(13) ""

  #############################################################################

  #
  # NOTE: This is an in-memory database with shared cache enabled.
  #
  set fileName(1) "file::memory:?cache=shared"

  #############################################################################

  #
  # NOTE: This is a normal on-disk database.
  #
  set fileName(2) [file join [getDatabaseDirectory] [appendArgs \
      stress- [pid] - [string trim [clock seconds] -] .db]]

  #############################################################################

  #
  # NOTE: Make sure to remove any stale database from previous test runs.
  #
  cleanupFile $fileName(2)
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579

    unset -nocomplain thread

    foreach index(1) [lsort -integer [array names workload]] {
      if {[lsearch -exact $noWorkload $index(1)] == -1} then {
        set thread($index(1)) [object create -alias System.Threading.Thread \
            [list apply $workload($index(1)) $fileName(1) $fileName(2) t1 \
            $count(1)]]
      }
    }

    foreach index(1) [list Start Join] {
      foreach index(2) [array names thread] {
        $thread($index(2)) $index(1)
      }







|







575
576
577
578
579
580
581
582
583
584
585
586
587
588
589

    unset -nocomplain thread

    foreach index(1) [lsort -integer [array names workload]] {
      if {[lsearch -exact $noWorkload $index(1)] == -1} then {
        set thread($index(1)) [object create -alias System.Threading.Thread \
            [list apply $workload($index(1)) $fileName(1) $fileName(2) t1 \
            $count(1)] 1048576]
      }
    }

    foreach index(1) [list Start Join] {
      foreach index(2) [array names thread] {
        $thread($index(2)) $index(1)
      }
Changes to Tests/tkt-84718e79fa.eagle.
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

  setupDb [set fileName tkt-84718e79fa-1.1.db]
} -body {
  sql execute $db "CREATE TABLE t1(x INTEGER PRIMARY KEY ASC);"
  sql execute $db "INSERT INTO t1 (x) VALUES(1);"

  for {set i 0} {$i < $c} {incr i} {
    set t($i) [object create -alias Thread threadStart]
  }

  set ::results [list]

  for {set i 0} {$i < $c} {incr i} {
    $t($i) Start
  }







|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

  setupDb [set fileName tkt-84718e79fa-1.1.db]
} -body {
  sql execute $db "CREATE TABLE t1(x INTEGER PRIMARY KEY ASC);"
  sql execute $db "INSERT INTO t1 (x) VALUES(1);"

  for {set i 0} {$i < $c} {incr i} {
    set t($i) [object create -alias Thread threadStart 1048576]
  }

  set ::results [list]

  for {set i 0} {$i < $c} {incr i} {
    $t($i) Start
  }