System.Data.SQLite

Check-in [34eb58d008]
Login

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

Overview
Comment:Enhancements to test suite infrastructure and comments.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 34eb58d008ce4660858a543fc0bb8f10852f78b7
User & Date: mistachkin 2012-10-08 13:48:54.955
Context
2012-10-09
03:26
Enhancements to the 'testce' project that allow it to be automated. check-in: 3c8aa6ed17 user: mistachkin tags: trunk
2012-10-08
13:48
Enhancements to test suite infrastructure and comments. check-in: 34eb58d008 user: mistachkin tags: trunk
12:17
Simplify implementation and usage of the getAppDomainPreamble test suite infrastructure procedure. check-in: a6e4e7b517 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Externals/Eagle/lib/Eagle1.0/vendor.eagle.
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
        #       contains a package index file?
        #
        if {[file exists [file join $dir Tests]] && \
            [file isdirectory [file join $dir Tests]] && \
            [file exists [file join $dir Tests pkgIndex.eagle]] && \
            [file isfile [file join $dir Tests pkgIndex.eagle]]} then {
          #
          # NOTE: If requested, give the caller access to the name of the
          #       directory we just found.
          #
          if {[string length $varName] > 0} then {
            upvar 1 $varName dir2
          }

          #







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
        #       contains a package index file?
        #
        if {[file exists [file join $dir Tests]] && \
            [file isdirectory [file join $dir Tests]] && \
            [file exists [file join $dir Tests pkgIndex.eagle]] && \
            [file isfile [file join $dir Tests pkgIndex.eagle]]} then {
          #
          # NOTE: If requested, give our caller access to the name of the
          #       directory we just found.
          #
          if {[string length $varName] > 0} then {
            upvar 1 $varName dir2
          }

          #
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219

    #
    # 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.
    #
    set have_vendor_directory [info exists ::vendor_directory]

    if {!$have_vendor_directory} then {
      set ::vendor_directory ""
    }

    #
    # NOTE: This procedure will attempt to find the vendor-specific testing
    #       infrastructure directory and add it to the auto-path for the
    #       current interpreter.  Normally, this will also set the variable
    #       created above to point to the directory added to the auto-path;
    #       however, this will not be done if the variable was not created
    #       by us.
    #
    addTestSuiteToAutoPath stdout [expr {$have_vendor_directory ? "" : \
        "::vendor_directory"}] false

    unset have_vendor_directory

    #
    # NOTE: If we actually found a vendor-specific testing infrastructure
    #       directory then modify the TestPath property of the current
    #       interpreter to point directly to it.
    #
    if {[string length $::vendor_directory] > 0} then {
      setupInterpreterTestPath stdout $::vendor_directory false
    }
  }
}

###############################################################################
############################### END VENDOR CODE ###############################
###############################################################################







|


|











|








|
|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219

    #
    # 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.
    #
    set have_vendor_directory [info exists vendor_directory]

    if {!$have_vendor_directory} then {
      set vendor_directory ""
    }

    #
    # NOTE: This procedure will attempt to find the vendor-specific testing
    #       infrastructure directory and add it to the auto-path for the
    #       current interpreter.  Normally, this will also set the variable
    #       created above to point to the directory added to the auto-path;
    #       however, this will not be done if the variable was not created
    #       by us.
    #
    addTestSuiteToAutoPath stdout [expr {$have_vendor_directory ? "" : \
        "vendor_directory"}] false

    unset have_vendor_directory

    #
    # NOTE: If we actually found a vendor-specific testing infrastructure
    #       directory then modify the TestPath property of the current
    #       interpreter to point directly to it.
    #
    if {[string length $vendor_directory] > 0} then {
      setupInterpreterTestPath stdout $vendor_directory false
    }
  }
}

###############################################################################
############################### END VENDOR CODE ###############################
###############################################################################
Changes to Tests/common.eagle.
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
      #
      if {[info exists ::test_overrides] && \
          [llength $::test_overrides] > 0} then {
        eval lappend varNames $::test_overrides
      }

      #
      # NOTE: If requested by the caller, add any additional variable
      #       names to copy now.
      #
      if {[llength $extraVarNames] > 0} then {
        eval lappend varNames $extraVarNames
      }

      #







|







341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
      #
      if {[info exists ::test_overrides] && \
          [llength $::test_overrides] > 0} then {
        eval lappend varNames $::test_overrides
      }

      #
      # NOTE: If requested by our caller, add any additional variable
      #       names to copy now.
      #
      if {[llength $extraVarNames] > 0} then {
        eval lappend varNames $extraVarNames
      }

      #
386
387
388
389
390
391
392
393
394
395
396
397

398
399
400
401
402
403
404
405



406
407
408

409

410
411
412
413
414
415
416
      }

      return $result
    }

    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
      #       entire script being returned will be substituted via [subst], in

      #       the context of our caller.  This step is necessary so that some
      #       limited context information, primarily related to the test build
      #       directory, can be transferred to the interpreter in the isolated
      #       application domain, making it able to successfully run tests that
      #       require one or more of the files in the build directory.  Callers
      #       to this procedure should keep in mind that the test script being
      #       returned cannot rely on any script library procedures not defined
      #       by the Eagle.Library package (i.e. "init.eagle").  Also, all



      #       variable references and all "nested" commands (i.e. those in
      #       square brackets), unless they are specially quoted, will end up
      #       being evaluated in the context of the calling interpreter and not

      #       the test interpreter created in the isolated application domain.

      #
      return [uplevel 1 [list subst [appendArgs $prefix {
        if {[hasRuntimeOption native]} then {
          object invoke Interpreter.GetActive AddRuntimeOption native
        }
      } [getTestOverridesPreamble [list path test_channel]] $suffix]]]
    }







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







386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
      }

      return $result
    }

    proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
      #
      # NOTE: This procedure returns a test setup script fragment suitable for
      #       evaluation by an interpreter created in an isolated application
      #       domain.  The script fragment being returned will be surrounded by
      #       the prefix and suffix "script fragments" specified by our caller,
      #       if any.  The entire script being returned will be substituted via
      #       [subst], in the context of our caller, before being returned.
      #       This step is necessary so that some limited context information,
      #       primarily related to the testing directories, can be transferred
      #       to the interpreter in the isolated application domain, making it
      #       able to successfully run tests that require one or more of the
      #       files in one of the testing directories.  Callers should keep in
      #       mind that the test script fragment being returned cannot rely on
      #       any script library procedures that are not provided by the Eagle
      #       library package (i.e. "init.eagle"), including those provided by
      #       the Eagle test package, unless the file containing them is loaded
      #       manually via some other mechanism (e.g. by including appropriate
      #       [package require] or [source] commands in the prefix or suffix
      #       script fragments).  Also, all variable references and all nested
      #       commands (i.e. those in square brackets) contained in the final
      #       script fragment will end up being evaluated in the context of the
      #       calling interpreter and not the target interpreter created in the
      #       isolated application domain unless the dollar signs and/or square
      #       brackets are specially quoted with backslashes.
      #
      return [uplevel 1 [list subst [appendArgs $prefix {
        if {[hasRuntimeOption native]} then {
          object invoke Interpreter.GetActive AddRuntimeOption native
        }
      } [getTestOverridesPreamble [list path test_channel]] $suffix]]]
    }
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
      # 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 unless the caller forbids it.
      #
      if {$temporary} then {
        sql execute $db [appendArgs \
            "PRAGMA temp_store_directory = \"" [getTemporaryDirectory] "\";"]
      }

      #







|







819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
      # 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 unless our caller forbids it.
      #
      if {$temporary} then {
        sql execute $db [appendArgs \
            "PRAGMA temp_store_directory = \"" [getTemporaryDirectory] "\";"]
      }

      #