System.Data.SQLite
Check-in [09c0313477]
Not logged in

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

Overview
Comment:Further test suite refinements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | netStandard21
Files: files | file ages | folders
SHA1: 09c03134775727a01b9bf433e37d8fdb0b015862
User & Date: mistachkin 2019-10-12 20:19:16
Context
2019-10-12
20:31
Add new test data file missing from the previous check-in. check-in: 3179c8eae5 user: mistachkin tags: netStandard21
20:19
Further test suite refinements. check-in: 09c0313477 user: mistachkin tags: netStandard21
2019-10-10
04:09
Add several missing test constraints. check-in: 610ef6001f user: mistachkin tags: netStandard21
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/basic.eagle.

    59     59         error fileName
    60     60   } -constraints {eagle SQLite file_System.Data.SQLite.dll file_test.exe\
    61     61   testExec winForms} -result {0 {}}}
    62     62   
    63     63   ###############################################################################
    64     64   
    65     65   runTest {test data-1.2 {unit tests from the 'testlinq' project} -setup {
           66  +  proc getTestLinqOutFileName { encodingName } {
           67  +    global testLinqExeFile
           68  +    global testLinqOutUtf8File
           69  +
           70  +    if {[regexp -nocase -- {^utf(?:-)?8$} $encodingName]} then {
           71  +      return $testLinqOutUtf8File
           72  +    } else {
           73  +      return $testLinqExeFile
           74  +    }
           75  +  }
           76  +
    66     77     copySampleDatabaseFiles
    67     78   
    68     79     #
    69     80     # NOTE: We need to make 100% sure that the console output encoding is the
    70     81     #       same as when the 'testlinq.out' file was created.
    71     82     #
    72     83     set savedEncoding [object invoke Console OutputEncoding]
    73     84   
    74     85     set encoding [object invoke System.Text.Encoding GetEncoding \
    75         -      [expr {[isDotNetCore] ? "iso-8859-1" : "Windows-1252"}]]
           86  +      [getOutputEncodingName]]
    76     87   
    77     88     object invoke Console OutputEncoding $encoding
    78     89   } -body {
    79     90     set output ""
    80     91   
    81     92     set code [catch {
    82     93       testClrExec $testLinqExeFile [list -eventflags Wait -directory \
................................................................................
    83     94           [file dirname $testLinqExeFile] -stdout output -success Success]
    84     95     } error]
    85     96   
    86     97     tlog "---- BEGIN STDOUT OUTPUT\n"
    87     98     tlog $output
    88     99     tlog "\n---- END STDOUT OUTPUT\n"
    89    100   
    90         -  list $code [string equal $output [readFile $testLinqOutFile]] \
    91         -      [expr {$code == 0 ? "" : $error}]
          101  +  list $code [string equal $output [readFile [getTestLinqOutFileName \
          102  +      [getOutputEncodingName]]]] [expr {$code == 0 ? "" : $error}]
    92    103   } -cleanup {
    93    104     catch {object invoke Console OutputEncoding $savedEncoding}
    94    105     catch {info previouspid true}
    95    106   
    96    107     unset -nocomplain code output error savedEncoding encoding
          108  +
          109  +  rename getTestLinqOutFileName ""
    97    110   } -constraints \
    98    111   {eagle command.object monoToDo SQLite file_System.Data.SQLite.dll\
    99    112   file_System.Data.SQLite.Linq.dll file_testlinq.exe file_northwindEF.db\
   100    113   file_testlinq.out testExec} -result {0 True {}}}
   101    114   
   102    115   ###############################################################################
   103    116   
   104    117   runTest {test data-1.3 {unit tests from the 'testef6' project} -setup {
          118  +  proc getTestLinqOutFileName { encodingName } {
          119  +    global testLinqExeFile
          120  +    global testLinqOutUtf8File
          121  +
          122  +    if {[regexp -nocase -- {^utf(?:-)?8$} $encodingName]} then {
          123  +      return $testLinqOutUtf8File
          124  +    } else {
          125  +      return $testLinqExeFile
          126  +    }
          127  +  }
          128  +
   105    129     copySampleDatabaseFiles
   106    130   
   107    131     #
   108    132     # NOTE: We need to make 100% sure that the console output encoding is the
   109    133     #       same as when the 'testlinq.out' file was created.
   110    134     #
   111    135     set savedEncoding [object invoke Console OutputEncoding]
   112    136   
   113    137     set encoding [object invoke System.Text.Encoding GetEncoding \
   114         -      [expr {[isDotNetCore] ? "iso-8859-1" : "Windows-1252"}]]
          138  +      [getOutputEncodingName]]
   115    139   
   116    140     object invoke Console OutputEncoding $encoding
   117    141   } -body {
   118    142     set output ""
   119    143   
   120    144     set code [catch {
   121    145       testClrExec $testEf6ExeFile [list -eventflags Wait -directory \
................................................................................
   122    146           [file dirname $testEf6ExeFile] -stdout output -success Success]
   123    147     } error]
   124    148   
   125    149     tlog "---- BEGIN STDOUT OUTPUT\n"
   126    150     tlog $output
   127    151     tlog "\n---- END STDOUT OUTPUT\n"
   128    152   
   129         -  list $code [string equal $output [readFile $testLinqOutFile]] \
   130         -      [expr {$code == 0 ? "" : $error}]
          153  +  list $code [string equal $output [readFile [getTestLinqOutFileName \
          154  +      [getOutputEncodingName]]]] [expr {$code == 0 ? "" : $error}]
   131    155   } -cleanup {
   132    156     catch {object invoke Console OutputEncoding $savedEncoding}
   133    157     catch {info previouspid true}
   134    158   
   135    159     unset -nocomplain code output error savedEncoding encoding
          160  +
          161  +  rename getTestLinqOutFileName ""
   136    162   } -constraints \
   137    163   {eagle command.object monoToDo SQLite file_EntityFramework.dll\
   138    164   file_System.Data.SQLite.dll file_System.Data.SQLite.EF6.dll file_testef6.exe\
   139    165   file_northwindEF.db file_testlinq.out testExec} -result {0 True {}}}
   140    166   
   141    167   ###############################################################################
   142    168   

Changes to lib/System.Data.SQLite/common.eagle.

  2702   2702           PRAGMA cache_size = 2000;
  2703   2703         }
  2704   2704   
  2705   2705         return [list \
  2706   2706             [sql execute -execute scalar $db "PRAGMA page_size;"] \
  2707   2707             [sql execute -execute scalar $db "PRAGMA cache_size;"]]
  2708   2708       }
         2709  +
         2710  +    proc getOutputEncodingName {} {
         2711  +      #
         2712  +      # HACK: Account for differences between Console output encodings on
         2713  +      #       the .NET Framework versus .NET Core, on Windows and POSIX.
         2714  +      #       Mono is not supported by this procedure as it is only used
         2715  +      #       by tests that do not run on Mono.
         2716  +      #
         2717  +      if {[isDotNetCore]} then {
         2718  +        if {[isWindows]} then {
         2719  +          #
         2720  +          # TODO: The reported output encoding for the Console on Windows
         2721  +          #       is actually "Codepage - 437".  Why?
         2722  +          #
         2723  +          return iso-8859-1
         2724  +        } else {
         2725  +          return utf-8
         2726  +        }
         2727  +      } else {
         2728  +        return Windows-1252
         2729  +      }
         2730  +    }
  2709   2731   
  2710   2732       proc normalizeExceptionMessage { value } {
  2711   2733         if {[string length $value] == 0} then {return $value}
  2712   2734         return [string map [list \r\n " ==> " \n " ==> "] $value]
  2713   2735       }
  2714   2736   
  2715   2737       proc extractSystemDataSQLiteExceptionMessage { value } {
................................................................................
  4905   4927           set mdaConfigFileNames [list \
  4906   4928               EagleShell32.exe.mda.config Installer.exe.mda.config \
  4907   4929               test.exe.mda.config testlinq.exe.mda.config \
  4908   4930               testef6.exe.mda.config]
  4909   4931   
  4910   4932           #
  4911   4933           # NOTE: Build the list of external files that we handle.  Some of
  4912         -        #       these files may be native and/or managed assemblies that are
  4913         -        #       required to perform various tests.
         4934  +        #       these files may be native and/or managed assemblies that
         4935  +        #       are required to perform various tests.
  4914   4936           #
  4915         -        set externalFileNames [list \
  4916         -            [file join EntityFramework lib [string map [list Fx ""] \
  4917         -            [string map [list netFx451 netFx45 netFx452 netFx45 netFx46 \
  4918         -            netFx45 netFx461 netFx45 netFx462 netFx45 netFx47 netFx45 \
  4919         -            netFx471 netFx45 netFx472 netFx45] [getBuildNetFx]]] \
  4920         -            EntityFramework.dll]]
         4937  +        if {[isDotNetCore]} then {
         4938  +          set externalFileNames [list \
         4939  +              [file join EntityFramework lib [string map [list \
         4940  +              netStandard21 netstandard2.1] [getBuildNetFx]] \
         4941  +              EntityFramework.dll]]
         4942  +        } else {
         4943  +          set externalFileNames [list \
         4944  +              [file join EntityFramework lib [string map [list \
         4945  +              Fx ""] [string map [list netFx451 netFx45 netFx452 \
         4946  +              netFx45 netFx46 netFx45 netFx461 netFx45 netFx462 \
         4947  +              netFx45 netFx47 netFx45 netFx471 netFx45 netFx472 \
         4948  +              netFx45] [getBuildNetFx]]] EntityFramework.dll]]
         4949  +        }
  4921   4950   
  4922   4951           #
  4923   4952           # NOTE: Build the list of native assembly files that we handle.
  4924   4953           #
  4925   4954           set nativeFileNames [list]
  4926   4955   
  4927   4956           eval lappend nativeFileNames [getNativeLibraryFileNamesOnly]
................................................................................
  5799   5828   
  5800   5829             #
  5801   5830             # NOTE: Setup the variables that refer to the various data files
  5802   5831             #       required by the tests in this file.
  5803   5832             #
  5804   5833             set testLinqOutFile [file nativename [file join \
  5805   5834                 [getSQLiteTestDataPath] testlinq.out]]
         5835  +
         5836  +          set testLinqOutUtf8File [file nativename [file join \
         5837  +              [getSQLiteTestDataPath] testlinq-utf8.out]]
  5806   5838   
  5807   5839             set northwindEfDbFile [file nativename [file join \
  5808   5840                 [file dirname [file dirname [getSQLiteTestDataPath]]] \
  5809   5841                 testlinq northwindEF.db]]
  5810   5842   
  5811   5843             set nonWalDbFile [file nativename [file join \
  5812   5844                 [getSQLiteTestDataPath] nonWal.db]]
................................................................................
  5914   5946                 checkForFile $test_channel $testEf6ExeFile testef6.exe
  5915   5947               }
  5916   5948   
  5917   5949               if {![haveConstraint [appendArgs file_ \
  5918   5950                   [file tail $testLinqOutFile]]]} then {
  5919   5951                 checkForFile $test_channel $testLinqOutFile
  5920   5952               }
         5953  +
         5954  +            if {![haveConstraint [appendArgs file_ \
         5955  +                [file tail $testLinqOutUtf8File]]]} then {
         5956  +              checkForFile $test_channel $testLinqOutUtf8File
         5957  +            }
  5921   5958   
  5922   5959               if {![haveConstraint [appendArgs file_ \
  5923   5960                   [file tail $northwindEfDbFile]]]} then {
  5924   5961                 checkForFile $test_channel $northwindEfDbFile
  5925   5962               }
  5926   5963   
  5927   5964               if {![haveConstraint [appendArgs file_ \
................................................................................
  6021   6058                 testUninstallVs2010LogFile testUninstallVs2008LogFile \
  6022   6059                 testUninstallVs2005LogFile testInstallVs2017LogFile \
  6023   6060                 testInstallVs2015LogFile testInstallVs2013LogFile \
  6024   6061                 testInstallVs2012LogFile testInstallVs2010LogFile \
  6025   6062                 testInstallVs2008LogFile testInstallVs2005LogFile
  6026   6063   
  6027   6064             unset -nocomplain \
  6028         -              northwindEfDbFile testLinqOutFile \
         6065  +              northwindEfDbFile testLinqOutUtf8File testLinqOutFile \
  6029   6066                 walDbFile nonWalDbFile
  6030   6067   
  6031   6068             unset -nocomplain \
  6032   6069                 testEf6ExeFile testLinqExeFile \
  6033   6070                 testExeFile systemDataSQLiteEf6DllFile \
  6034   6071                 systemDataSQLiteLinqDllFile systemDataSQLiteDllFile \
  6035   6072                 sqliteDesignerDllFile installerExeFile \