System.Data.SQLite
Check-in [34eb58d008]
Not logged in

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

Overview
Comment:Enhancements to test suite infrastructure and comments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 34eb58d008ce4660858a543fc0bb8f10852f78b7
User & Date: mistachkin 2012-10-08 13:48:54
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
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Externals/Eagle/lib/Eagle1.0/vendor.eagle.

    79     79           #       contains a package index file?
    80     80           #
    81     81           if {[file exists [file join $dir Tests]] && \
    82     82               [file isdirectory [file join $dir Tests]] && \
    83     83               [file exists [file join $dir Tests pkgIndex.eagle]] && \
    84     84               [file isfile [file join $dir Tests pkgIndex.eagle]]} then {
    85     85             #
    86         -          # NOTE: If requested, give the caller access to the name of the
           86  +          # NOTE: If requested, give our caller access to the name of the
    87     87             #       directory we just found.
    88     88             #
    89     89             if {[string length $varName] > 0} then {
    90     90               upvar 1 $varName dir2
    91     91             }
    92     92   
    93     93             #
................................................................................
   180    180   
   181    181       #
   182    182       # NOTE: This variable will contain the name of the directory containing the
   183    183       #       vendor-specific testing infrastructure.  If the variable does not
   184    184       #       already exist, create it; otherwise, it has been overridden and the
   185    185       #       existing value should be left intact.
   186    186       #
   187         -    set have_vendor_directory [info exists ::vendor_directory]
          187  +    set have_vendor_directory [info exists vendor_directory]
   188    188   
   189    189       if {!$have_vendor_directory} then {
   190         -      set ::vendor_directory ""
          190  +      set vendor_directory ""
   191    191       }
   192    192   
   193    193       #
   194    194       # NOTE: This procedure will attempt to find the vendor-specific testing
   195    195       #       infrastructure directory and add it to the auto-path for the
   196    196       #       current interpreter.  Normally, this will also set the variable
   197    197       #       created above to point to the directory added to the auto-path;
   198    198       #       however, this will not be done if the variable was not created
   199    199       #       by us.
   200    200       #
   201    201       addTestSuiteToAutoPath stdout [expr {$have_vendor_directory ? "" : \
   202         -        "::vendor_directory"}] false
          202  +        "vendor_directory"}] false
   203    203   
   204    204       unset have_vendor_directory
   205    205   
   206    206       #
   207    207       # NOTE: If we actually found a vendor-specific testing infrastructure
   208    208       #       directory then modify the TestPath property of the current
   209    209       #       interpreter to point directly to it.
   210    210       #
   211         -    if {[string length $::vendor_directory] > 0} then {
   212         -      setupInterpreterTestPath stdout $::vendor_directory false
          211  +    if {[string length $vendor_directory] > 0} then {
          212  +      setupInterpreterTestPath stdout $vendor_directory false
   213    213       }
   214    214     }
   215    215   }
   216    216   
   217    217   ###############################################################################
   218    218   ############################### END VENDOR CODE ###############################
   219    219   ###############################################################################

Changes to Tests/common.eagle.

   341    341         #
   342    342         if {[info exists ::test_overrides] && \
   343    343             [llength $::test_overrides] > 0} then {
   344    344           eval lappend varNames $::test_overrides
   345    345         }
   346    346   
   347    347         #
   348         -      # NOTE: If requested by the caller, add any additional variable
          348  +      # NOTE: If requested by our caller, add any additional variable
   349    349         #       names to copy now.
   350    350         #
   351    351         if {[llength $extraVarNames] > 0} then {
   352    352           eval lappend varNames $extraVarNames
   353    353         }
   354    354   
   355    355         #
................................................................................
   386    386         }
   387    387   
   388    388         return $result
   389    389       }
   390    390   
   391    391       proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
   392    392         #
   393         -      # NOTE: This procedure returns a test setup script suitable for evaluation
   394         -      #       by a test interpreter created in an isolated application domain.
   395         -      #       The script being returned will be surrounded by the prefix and
   396         -      #       suffix "script fragments" specified by our caller, if any.  The
   397         -      #       entire script being returned will be substituted via [subst], in
   398         -      #       the context of our caller.  This step is necessary so that some
   399         -      #       limited context information, primarily related to the test build
   400         -      #       directory, can be transferred to the interpreter in the isolated
   401         -      #       application domain, making it able to successfully run tests that
   402         -      #       require one or more of the files in the build directory.  Callers
   403         -      #       to this procedure should keep in mind that the test script being
   404         -      #       returned cannot rely on any script library procedures not defined
   405         -      #       by the Eagle.Library package (i.e. "init.eagle").  Also, all
   406         -      #       variable references and all "nested" commands (i.e. those in
   407         -      #       square brackets), unless they are specially quoted, will end up
   408         -      #       being evaluated in the context of the calling interpreter and not
   409         -      #       the test interpreter created in the isolated application domain.
          393  +      # NOTE: This procedure returns a test setup script fragment suitable for
          394  +      #       evaluation by an interpreter created in an isolated application
          395  +      #       domain.  The script fragment being returned will be surrounded by
          396  +      #       the prefix and suffix "script fragments" specified by our caller,
          397  +      #       if any.  The entire script being returned will be substituted via
          398  +      #       [subst], in the context of our caller, before being returned.
          399  +      #       This step is necessary so that some limited context information,
          400  +      #       primarily related to the testing directories, can be transferred
          401  +      #       to the interpreter in the isolated application domain, making it
          402  +      #       able to successfully run tests that require one or more of the
          403  +      #       files in one of the testing directories.  Callers should keep in
          404  +      #       mind that the test script fragment being returned cannot rely on
          405  +      #       any script library procedures that are not provided by the Eagle
          406  +      #       library package (i.e. "init.eagle"), including those provided by
          407  +      #       the Eagle test package, unless the file containing them is loaded
          408  +      #       manually via some other mechanism (e.g. by including appropriate
          409  +      #       [package require] or [source] commands in the prefix or suffix
          410  +      #       script fragments).  Also, all variable references and all nested
          411  +      #       commands (i.e. those in square brackets) contained in the final
          412  +      #       script fragment will end up being evaluated in the context of the
          413  +      #       calling interpreter and not the target interpreter created in the
          414  +      #       isolated application domain unless the dollar signs and/or square
          415  +      #       brackets are specially quoted with backslashes.
   410    416         #
   411    417         return [uplevel 1 [list subst [appendArgs $prefix {
   412    418           if {[hasRuntimeOption native]} then {
   413    419             object invoke Interpreter.GetActive AddRuntimeOption native
   414    420           }
   415    421         } [getTestOverridesPreamble [list path test_channel]] $suffix]]]
   416    422       }
................................................................................
   813    819         # NOTE: Open the database connection now, placing the opaque handle value
   814    820         #       into the variable specified by our caller.
   815    821         #
   816    822         set db [sql open -type SQLite [subst $connection]]
   817    823   
   818    824         #
   819    825         # NOTE: Configure the temporary directory for the newly opened database
   820         -      #       connection now unless the caller forbids it.
          826  +      #       connection now unless our caller forbids it.
   821    827         #
   822    828         if {$temporary} then {
   823    829           sql execute $db [appendArgs \
   824    830               "PRAGMA temp_store_directory = \"" [getTemporaryDirectory] "\";"]
   825    831         }
   826    832   
   827    833         #