System.Data.SQLite
Check-in [295690bb91]
Not logged in

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

Overview
Comment:Add detailed comments on the 'getAppDomainPreamble' unit test infrastructure procedure and its role in running tests that require an isolated application domain.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 295690bb913be765e0068a4ed3c76be3e76b0796
User & Date: mistachkin 2011-10-11 12:13:56
Context
2011-10-13
06:19
Both BOOLEAN and BOOL should end up being presented as the System.Boolean CLR type. Fix for ticket [544dba0a2f]. check-in: 453dc69391 user: mistachkin tags: trunk
2011-10-11
12:13
Add detailed comments on the 'getAppDomainPreamble' unit test infrastructure procedure and its role in running tests that require an isolated application domain. check-in: 295690bb91 user: mistachkin tags: trunk
07:21
Merge all fixes, enhancements, and tests related to ticket [343d392b51] into trunk. check-in: fc49363310 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/common.eagle.

   152    152   
   153    153       proc getBinaryFileName { fileName } {
   154    154         return [file nativename \
   155    155             [file join [getBinaryDirectory] [file tail $fileName]]]
   156    156       }
   157    157   
   158    158       proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
          159  +      #
          160  +      # NOTE: This procedure returns a test setup script suitable for evaluation
          161  +      #       by a test interpreter created in an isolated application domain.
          162  +      #       The script being returned will be surrounded by the prefix and
          163  +      #       suffix "script fragments" specified by the caller, if any.  The
          164  +      #       entire script being returned will be substituted via [subst], in
          165  +      #       the context of the caller.  This step is necessary so that some
          166  +      #       limited context information, primarily related to the test build
          167  +      #       directory, can be transferred to the interpreter in the isolated
          168  +      #       application domain, making it able to successfully run tests that
          169  +      #       require one or more of the files in the build directory.  Callers
          170  +      #       to this procedure should keep in mind that the test script being
          171  +      #       returned cannot only rely on any script library procedures not
          172  +      #       included in the EagleLibrary package (i.e. "init.eagle").  Also,
          173  +      #       all variable references and all "nested" commands (i.e. those in
          174  +      #       square brackets), unless they are specially quoted, will end up
          175  +      #       being evaluated in the context of the calling interpreter and not
          176  +      #       the test interpreter created in the isolated application domain.
          177  +      #
   159    178         return [uplevel 1 [list subst [appendArgs $prefix {
   160    179           if {[hasRuntimeOption native]} then {
   161    180             object invoke Interpreter.GetActive AddRuntimeOption native
   162    181           }
   163    182   
   164    183           set ::path {$::path}
   165    184           set ::test_year {[getBuildYear]}
................................................................................
   406    425         #
   407    426         # NOTE: Open the database connection now, placing the opaque handle value
   408    427         #       into the variable specified by the caller.
   409    428         #
   410    429         set db [sql open -type SQLite [subst $connection]]
   411    430       }
   412    431   
   413         -    proc cleanupDb {fileName {varName db}} {
          432  +    proc cleanupDb { fileName {varName db} } {
   414    433         #
   415    434         # NOTE: Refer to the specified variable (e.g. "db") in the context of the
   416    435         #       caller.  The handle to the opened database is stored there.
   417    436         #
   418    437         upvar 1 $varName db
   419    438   
   420    439         #