System.Data.SQLite
Check-in [0c98859313]
Not logged in

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

Overview
Comment:In the test suite infrastructure, enable verbose mode by default for all file copy/delete operations.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0c988593134df6632bfec3371894f0526bf1fb2a
User & Date: mistachkin 2016-08-30 03:12:05
Context
2016-08-30
14:15
Break out the mixed-mode assembly file delete/copy handling in the test suite infrastructure. check-in: e4a002b0c0 user: mistachkin tags: trunk
03:12
In the test suite infrastructure, enable verbose mode by default for all file copy/delete operations. check-in: 0c98859313 user: mistachkin tags: trunk
00:49
Revise a diagnostic message in the native library pre-loader. In the test suite infrastructure, always check for ::tcl_platform(machine) before trying to use it. check-in: 2bce278174 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/tkt-da685c0bac.eagle.

    16     16   ###############################################################################
    17     17   
    18     18   package require System.Data.SQLite.Test
    19     19   runSQLiteTestPrologue
    20     20   
    21     21   ###############################################################################
    22     22   
    23         -moveSystemDataSQLiteDllConfig false true
           23  +moveSystemDataSQLiteDllConfig false
    24     24   
    25     25   ###############################################################################
    26     26   
    27     27   runTest {test tkt-da685c0bac-1.1 {GetXmlConfigFileName path handling} -setup \
    28     28       [getAppDomainPreamble] -body {
    29     29     package require Eagle.Library
    30     30     package require Eagle.Test
    31     31     package require System.Data.SQLite.Test
    32     32   
    33         -  moveSystemDataSQLiteDllConfig false true
           33  +  moveSystemDataSQLiteDllConfig false
    34     34   
    35     35     object load -loadtype Bytes [base64 encode [readFile [file join \
    36     36         [getBinaryDirectory] System.Data.SQLite.dll]]]
    37     37   
    38     38     object invoke -flags +NonPublic \
    39     39         System.Data.SQLite.UnsafeNativeMethods GetXmlConfigFileName
    40     40   } -cleanup {
    41         -  moveSystemDataSQLiteDllConfig true true
           41  +  moveSystemDataSQLiteDllConfig true
    42     42   } -isolationLevel AppDomain -constraints \
    43     43   {eagle command.object compile.ISOLATED_INTERPRETERS System.Data.SQLite\
    44     44   defineConstant.System.Data.SQLite.USE_INTEROP_DLL} -result {}}
    45     45   
    46     46   ###############################################################################
    47     47   
    48         -moveSystemDataSQLiteDllConfig true true
           48  +moveSystemDataSQLiteDllConfig true
    49     49   
    50     50   ###############################################################################
    51     51   
    52     52   runSQLiteTestEpilogue
    53     53   runTestEpilogue

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

   231    231               2012 {
   232    232                 return netFx45
   233    233               }
   234    234               2013 {
   235    235                 return netFx451; # TODO: Or "netFx452"?
   236    236               }
   237    237               2015 {
   238         -              return netFx46; # TODO: Or "netFx461"?
          238  +              return netFx46; # TODO: Or "netFx461" / "netFx462"?
   239    239               }
   240    240               default {
   241    241                 return netFx35; # TODO: Good "fallback" default?
   242    242               }
   243    243             }
   244    244           }
   245    245         }
   246    246       }
   247    247   
   248    248       #
   249    249       # NOTE: This procedure should return non-zero if the configured test
   250    250       #       platform is most likely the default for this machine.
   251    251       #
   252         -    proc isDefaultBuildPlatform { {verbose false} } {
          252  +    proc isDefaultBuildPlatform { {verbose true} } {
   253    253         #
   254    254         # NOTE: Running on WoW64 is never the default platform.
   255    255         #
   256    256         if {[isRunningWoW64]} then {
   257    257           if {$verbose} then {
   258    258             tputs $::test_channel \
   259    259                 "---- detected non-default platform (WoW64)\n"
   260    260           }
          261  +
   261    262           return false
   262    263         }
   263    264   
   264    265         #
   265    266         # NOTE: This has a good chance of being the default platform.
   266    267         #
   267    268         if {$verbose} then {
   268    269           tputs $::test_channel "---- detected default platform\n"
   269    270         }
          271  +
   270    272         return true
   271    273       }
   272    274   
   273    275       proc getBuildPlatform { native } {
   274    276         if {[info exists ::test_platform] && \
   275    277             [string length $::test_platform] > 0} then {
   276    278           #
................................................................................
  1130   1132         if {[string length $result] > 0} then {
  1131   1133           append result \n
  1132   1134         }
  1133   1135   
  1134   1136         return $result
  1135   1137       }
  1136   1138   
  1137         -    proc moveSystemDataSQLiteDllConfig { {restore false} {verbose false} } {
         1139  +    proc moveSystemDataSQLiteDllConfig { {restore false} {verbose true} } {
  1138   1140         set directory [object invoke AppDomain CurrentDomain.BaseDirectory]
  1139   1141   
  1140   1142         if {[string length $directory] == 0} then {
  1141   1143           if {$verbose} then {
  1142   1144             tputs $::test_channel [appendArgs \
  1143   1145                 "---- skipped moving \"System.Data.SQLite.dll.config\", " \
  1144   1146                 "no base directory\n"]
  1145   1147           }
         1148  +
  1146   1149           return
  1147   1150         }
  1148   1151   
  1149   1152         set fileName(1) [file normalize \
  1150   1153             [file join $directory System.Data.SQLite.dll.config]]
  1151   1154   
  1152   1155         set fileName(2) [appendArgs $fileName(1) .moved]
................................................................................
  1225   1228           catch {
  1226   1229             changeNativeRuntimeOption [hasRuntimeOption native]
  1227   1230           }
  1228   1231         } [getTestOverridesPreamble [list path test_channel]] $suffix]]]
  1229   1232       }
  1230   1233   
  1231   1234       proc tryCopyExternalFile {
  1232         -            fileName {platform ""} {newFileName ""} {verbose false} } {
         1235  +            fileName {platform ""} {newFileName ""} {verbose true} } {
  1233   1236         set sourceFileName [getExternalFileName $fileName]
  1234   1237   
  1235   1238         if {![file exists $sourceFileName]} then {
  1236   1239           if {$verbose} then {
  1237   1240             tputs $::test_channel [appendArgs \
  1238   1241                 "---- skipped copying external file \"" $sourceFileName \
  1239   1242                 "\", it does not exist\n"]
  1240   1243           }
         1244  +
  1241   1245           return
  1242   1246         }
  1243   1247   
  1244   1248         if {[string length $newFileName] > 0} then {
  1245   1249           set targetFileName [getBinaryFileName $newFileName $platform]
  1246   1250         } else {
  1247   1251           set targetFileName [getBinaryFileName $fileName $platform]
................................................................................
  1249   1253   
  1250   1254         set targetDirectory [file dirname $targetFileName]
  1251   1255   
  1252   1256         if {[catch {
  1253   1257           if {![file exists $targetDirectory]} then {
  1254   1258             file mkdir $targetDirectory
  1255   1259           }
         1260  +
  1256   1261           file copy -force $sourceFileName $targetFileName
  1257   1262         }] == 0} then {
  1258   1263           tputs $::test_channel [appendArgs \
  1259   1264               "---- copied external file from \"" $sourceFileName "\" to \"" \
  1260   1265               $targetFileName \"\n]
  1261   1266         } else {
  1262   1267           tputs $::test_channel [appendArgs \
  1263   1268               "---- failed to copy external file from \"" $sourceFileName \
  1264   1269               "\" to \"" $targetFileName \"\n]
  1265   1270         }
  1266   1271       }
  1267   1272   
  1268   1273       proc tryCopyBinaryFile {
  1269         -            fileName {platform ""} {newFileName ""} {verbose false} } {
         1274  +            fileName {platform ""} {newFileName ""} {verbose true} } {
  1270   1275         set sourceFileName [getBinaryFileName $fileName $platform]
  1271   1276   
  1272   1277         if {![file exists $sourceFileName]} then {
  1273   1278           if {$verbose} then {
  1274   1279             tputs $::test_channel [appendArgs \
  1275   1280                 "---- skipped copying binary file \"" $sourceFileName \
  1276   1281                 "\", it does not exist\n"]
  1277   1282           }
         1283  +
  1278   1284           return
  1279   1285         }
  1280   1286   
  1281   1287         if {[string length $newFileName] > 0} then {
  1282   1288           set targetFileName [getBuildFileName $newFileName $platform]
  1283   1289         } else {
  1284   1290           set targetFileName [getBuildFileName $fileName $platform]
................................................................................
  1286   1292   
  1287   1293         set targetDirectory [file dirname $targetFileName]
  1288   1294   
  1289   1295         if {[catch {
  1290   1296           if {![file exists $targetDirectory]} then {
  1291   1297             file mkdir $targetDirectory
  1292   1298           }
         1299  +
  1293   1300           file copy -force $sourceFileName $targetFileName
  1294   1301         }] == 0} then {
  1295   1302           tputs $::test_channel [appendArgs \
  1296   1303               "---- copied binary file from \"" $sourceFileName "\" to \"" \
  1297   1304               $targetFileName \"\n]
  1298   1305         } else {
  1299   1306           tputs $::test_channel [appendArgs \
  1300   1307               "---- failed to copy binary file from \"" $sourceFileName \
  1301   1308               "\" to \"" $targetFileName \"\n]
  1302   1309         }
  1303   1310       }
  1304   1311   
  1305   1312       proc tryCopyBuildFile {
  1306         -            fileName {platform ""} {newFileName ""} {verbose false} } {
         1313  +            fileName {platform ""} {newFileName ""} {verbose true} } {
  1307   1314         set sourceFileName [getBuildFileName $fileName $platform]
  1308   1315   
  1309   1316         if {![file exists $sourceFileName]} then {
  1310   1317           if {$verbose} then {
  1311   1318             tputs $::test_channel [appendArgs \
  1312   1319                 "---- skipped copying build file \"" $sourceFileName \
  1313   1320                 "\", it does not exist\n"]
  1314   1321           }
         1322  +
  1315   1323           return
  1316   1324         }
  1317   1325   
  1318   1326         if {[string length $newFileName] > 0} then {
  1319   1327           set targetFileName [getBinaryFileName $newFileName $platform]
  1320   1328         } else {
  1321   1329           set targetFileName [getBinaryFileName $fileName $platform]
................................................................................
  1323   1331   
  1324   1332         set targetDirectory [file dirname $targetFileName]
  1325   1333   
  1326   1334         if {[catch {
  1327   1335           if {![file exists $targetDirectory]} then {
  1328   1336             file mkdir $targetDirectory
  1329   1337           }
         1338  +
  1330   1339           file copy -force $sourceFileName $targetFileName
  1331   1340         }] == 0} then {
  1332   1341           tputs $::test_channel [appendArgs \
  1333   1342               "---- copied build file from \"" $sourceFileName "\" to \"" \
  1334   1343               $targetFileName \"\n]
  1335   1344         } else {
  1336   1345           tputs $::test_channel [appendArgs \
  1337   1346               "---- failed to copy build file from \"" $sourceFileName \
  1338   1347               "\" to \"" $targetFileName \"\n]
  1339   1348         }
  1340   1349       }
  1341   1350   
  1342         -    proc tryDeleteBinaryFile { fileName {platform ""} {verbose false} } {
         1351  +    proc tryDeleteBinaryFile { fileName {platform ""} {verbose true} } {
  1343   1352         set fileName [getBinaryFileName $fileName $platform]
  1344   1353   
  1345   1354         if {![file exists $fileName]} then {
  1346   1355           if {$verbose} then {
  1347   1356             tputs $::test_channel [appendArgs \
  1348   1357                 "---- skipped deleting binary file \"" $fileName \
  1349   1358                 "\", it does not exist\n"]
  1350   1359           }
         1360  +
  1351   1361           return
  1352   1362         }
  1353   1363   
  1354   1364         if {[catch {file delete $fileName}] == 0} then {
  1355   1365           tputs $::test_channel [appendArgs \
  1356   1366               "---- deleted binary file \"" $fileName \"\n]
  1357   1367         } else {
  1358   1368           tputs $::test_channel [appendArgs \
  1359   1369               "---- failed to delete binary file \"" $fileName \"\n]
  1360   1370         }
  1361   1371       }
  1362   1372   
  1363         -    proc tryDeleteBuildFile { fileName {platform ""} {verbose false} } {
         1373  +    proc tryDeleteBuildFile { fileName {platform ""} {verbose true} } {
  1364   1374         set fileName [getBuildFileName $fileName $platform]
  1365   1375   
  1366   1376         if {![file exists $fileName]} then {
  1367   1377           if {$verbose} then {
  1368   1378             tputs $::test_channel [appendArgs \
  1369   1379                 "---- skipped deleting build file \"" $fileName \
  1370   1380                 "\", it does not exist\n"]
  1371   1381           }
         1382  +
  1372   1383           return
  1373   1384         }
  1374   1385   
  1375   1386         if {[catch {file delete $fileName}] == 0} then {
  1376   1387           tputs $::test_channel [appendArgs \
  1377   1388               "---- deleted build file \"" $fileName \"\n]
  1378   1389         } else {
  1379   1390           tputs $::test_channel [appendArgs \
  1380   1391               "---- failed to delete build file \"" $fileName \"\n]
  1381   1392         }
  1382   1393       }
  1383   1394   
  1384   1395       proc tryCopyAssembly {
  1385         -            fileName {platform ""} {pdb true} {verbose false} } {
         1396  +            fileName {platform ""} {pdb true} {verbose true} } {
  1386   1397         tryCopyBuildFile $fileName $platform "" $verbose
  1387   1398   
  1388   1399         if {$pdb} then {
  1389   1400           tryCopyBuildFile [appendArgs \
  1390   1401               [file rootname $fileName] .pdb] $platform "" $verbose
  1391   1402         }
  1392   1403       }
  1393   1404   
  1394   1405       proc tryDeleteAssembly {
  1395         -            fileName {platform ""} {pdb true} {verbose false} } {
         1406  +            fileName {platform ""} {pdb true} {verbose true} } {
  1396   1407         tryDeleteBinaryFile $fileName $platform $verbose
  1397   1408   
  1398   1409         if {$pdb} then {
  1399   1410           tryDeleteBinaryFile [appendArgs \
  1400   1411               [file rootname $fileName] .pdb] $platform $verbose
  1401   1412         }
  1402   1413       }
................................................................................
  3783   3794           #
  3784   3795           # NOTE: Build the list of managed assembly files that we handle.
  3785   3796           #
  3786   3797           set managedFileNames [list \
  3787   3798               System.Data.SQLite.dll System.Data.SQLite.Linq.dll \
  3788   3799               System.Data.SQLite.EF6.dll]
  3789   3800   
         3801  +        #
         3802  +        # NOTE: Show the various lists of file names that are handled by this
         3803  +        #       procedure.
         3804  +        #
         3805  +        tputs $::test_channel [appendArgs \
         3806  +            "---- list of \"configuration\" file names is: " \
         3807  +            $configFileNames \n]
         3808  +
         3809  +        tputs $::test_channel [appendArgs \
         3810  +            "---- list of \"MDA configuration\" file names is: " \
         3811  +            $mdaConfigFileNames \n]
         3812  +
         3813  +        tputs $::test_channel [appendArgs \
         3814  +            "---- list of \"external\" file names is: " $externalFileNames \n]
         3815  +
         3816  +        tputs $::test_channel [appendArgs \
         3817  +            "---- list of \"native\" file names is: " $nativeFileNames \n]
         3818  +
         3819  +        tputs $::test_channel [appendArgs \
         3820  +            "---- list of \"managed\" file names is: " $managedFileNames \n]
         3821  +
  3790   3822           #
  3791   3823           # NOTE: Remove any test constraints that refer to the native and/or
  3792   3824           #       managed assembly files that we handle unless forbidden from
  3793   3825           #       doing so.
  3794   3826           #
  3795   3827           if {![info exists ::no(sqliteRemoveConstraints)]} then {
  3796   3828             foreach fileName $configFileNames {
................................................................................
  3915   3947             }
  3916   3948   
  3917   3949             #
  3918   3950             # NOTE: Skip trying to copy any files if instructed.
  3919   3951             #
  3920   3952             if {![info exists ::no(copySqliteFiles)]} then {
  3921   3953               if {![info exists ::no(copySqliteConfigFiles)]} then {
         3954  +              tputs $::test_channel \
         3955  +                  "---- start copying configuration files\n"
         3956  +
  3922   3957                 foreach fileName $configFileNames {
  3923   3958                   tryCopyBuildFile $fileName
  3924   3959                 }
         3960  +
         3961  +              tputs $::test_channel \
         3962  +                  "---- end copying configuration files\n"
  3925   3963               }
  3926   3964   
  3927   3965               if {![info exists ::no(copySqliteExternalFiles)]} then {
  3928   3966                 #
  3929   3967                 # NOTE: Copy the Managed Debugging Assistants (MDA) configuration
  3930   3968                 #       file for the Eagle shell to the build output directory,
  3931   3969                 #       while using each of the names of the various legacy test
  3932   3970                 #       executables.  This will help to make sure that all the
  3933   3971                 #       legacy tests run with exactly the same set of Managed
  3934   3972                 #       Debugging Assistants configured.
  3935   3973                 #
         3974  +              tputs $::test_channel \
         3975  +                  "---- start copying MDA configuration files\n"
         3976  +
  3936   3977                 foreach fileName $mdaConfigFileNames {
  3937   3978                   tryCopyBinaryFile EagleShell.exe.mda.config "" $fileName
  3938   3979                 }
  3939   3980   
         3981  +              tputs $::test_channel \
         3982  +                  "---- end copying MDA configuration files\n"
         3983  +
  3940   3984                 #
  3941   3985                 # NOTE: Copy the external binaries, if any, to the directory that
  3942   3986                 #       contains the Eagle shell.  This is typically used to make
  3943   3987                 #       sure assemblies referenced by the ones being tested are
  3944   3988                 #       available during the testing process.
  3945   3989                 #
         3990  +              tputs $::test_channel "---- start copying external files\n"
         3991  +
  3946   3992                 foreach fileName $externalFileNames {
  3947   3993                   tryCopyExternalFile $fileName
  3948   3994                 }
         3995  +
         3996  +              tputs $::test_channel "---- end copying external files\n"
  3949   3997               }
  3950   3998   
  3951   3999               if {![info exists ::no(copySqliteNativeFiles)]} then {
  3952   4000                 #
  3953   4001                 # NOTE: If the test platform is likely the default for this
  3954   4002                 #       machine, also try to copy the native files to the
  3955   4003                 #       binary location.
  3956   4004                 #
  3957   4005                 if {![info exists ::no(copySqliteImplicitFiles)] && \
  3958         -                  [isDefaultBuildPlatform true]} then {
         4006  +                  [isDefaultBuildPlatform]} then {
         4007  +                tputs $::test_channel \
         4008  +                    "---- start copying implicit native files\n"
         4009  +
  3959   4010                   foreach fileName $nativeFileNames {
  3960   4011                     tryCopyAssembly $fileName
  3961   4012                   }
         4013  +
         4014  +                tputs $::test_channel \
         4015  +                    "---- end copying implicit native files\n"
  3962   4016                 }
  3963   4017   
  3964   4018                 if {![info exists ::no(copySqliteNonImplicitFiles)]} then {
  3965   4019                   if {![info exists ::no(copySqlitePlatformFiles)] && \
  3966   4020                       [string length $platform] > 0} then {
         4021  +                  tputs $::test_channel [appendArgs \
         4022  +                      "---- start copying native files for platform \"" \
         4023  +                      $platform "\" files\n"]
         4024  +
  3967   4025                     foreach fileName $nativeFileNames {
  3968   4026                       tryCopyAssembly $fileName $platform
  3969   4027                     }
         4028  +
         4029  +                  tputs $::test_channel [appendArgs \
         4030  +                      "---- end copying native files for platform \"" \
         4031  +                      $platform "\" files\n"]
  3970   4032                   }
  3971   4033   
  3972   4034                   if {![info exists ::no(copySqliteArchitectureFiles)] && \
  3973   4035                       [string length $architecture] > 0} then {
         4036  +                  tputs $::test_channel [appendArgs \
         4037  +                      "---- start copying native files for architecture \"" \
         4038  +                      $architecture "\" files\n"]
         4039  +
  3974   4040                     foreach fileName $nativeFileNames {
  3975   4041                       tryCopyAssembly $fileName $architecture
  3976   4042                     }
         4043  +
         4044  +                  tputs $::test_channel [appendArgs \
         4045  +                      "---- end copying native files for architecture \"" \
         4046  +                      $architecture "\" files\n"]
  3977   4047                   }
  3978   4048                 }
  3979   4049               }
  3980   4050   
  3981   4051               if {![info exists ::no(copySqliteManagedFiles)]} then {
         4052  +              tputs $::test_channel "---- start copying managed files\n"
         4053  +
  3982   4054                 foreach fileName $managedFileNames {
  3983   4055                   tryCopyAssembly $fileName
  3984   4056                 }
         4057  +
         4058  +              tputs $::test_channel "---- end copying managed files\n"
  3985   4059               }
  3986   4060             }
  3987   4061   
  3988   4062             #
  3989   4063             # NOTE: Skip trying to load any files if instructed.
  3990   4064             #
  3991   4065             if {![info exists ::no(loadSqliteFiles)]} then {