System.Data.SQLite
Check-in [ba3ecbf6c4]
Not logged in

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

Overview
Comment:More enhancements to the test suite infrastructure.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ba3ecbf6c4dde69651acd22d5691b8866a868e02
User & Date: mistachkin 2014-01-06 01:45:05
Context
2014-01-06
04:03
Move the compile-time options for the interop assembly for Windows Embedded Compact 2013 to the properties file. check-in: bbbb338f7a user: mistachkin tags: trunk
01:45
More enhancements to the test suite infrastructure. check-in: ba3ecbf6c4 user: mistachkin tags: trunk
2014-01-04
09:23
Further enhance the connection flag diagnostics. check-in: e06d302ebf user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/common.eagle.

1374
1375
1376
1377
1378
1379
1380
1381

















1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
....
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
....
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
....
2402
2403
2404
2405
2406
2407
2408

2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419

2420
2421
2422
2423
2424
2425
2426
....
2485
2486
2487
2488
2489
2490
2491

2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502

2503
2504
2505
2506
2507
2508
2509
....
2516
2517
2518
2519
2520
2521
2522

2523
2524
2525
2526
2527
2528
2529
2530

2531
2532
2533
2534
2535
2536
2537
....
2624
2625
2626
2627
2628
2629
2630




2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
....
2783
2784
2785
2786
2787
2788
2789






















2790
2791
2792
2793
2794
2795
2796
        return [uplevel 1 [list \
            sql execute -execute $execute -format $format $db $sql]]
      } finally {
        cleanupDb $fileName db false false false
      }
    }
 
    proc getConnectionFlags { flags {quiet false} } {

















      #
      # NOTE: Show (and log) the local connection flags and the associated
      #       data source or file name.
      #
      if {!$quiet} then {
        if {[info exists ::dataSource] && ![array exists ::dataSource]} then {
          set database [appendArgs "data source \"" $::dataSource \"]
        } elseif {[info exists ::fileName] && ![array exists ::fileName]} then {
          set database [appendArgs "file name \"" $::fileName \"]
        } else {
          set database <unknown>
        }

        tputs $::test_channel [appendArgs \
            "---- local connection flags for " $database \
            " are: " [expr {[string length $flags] > 0 ? \
            [appendArgs \" $flags \"] : "<none>"}] \n]
      }

      #
................................................................................
        set flags [combineFlags $flags $::connection_flags]

        #
        # NOTE: Show (and log) the new effective connection flags.
        #
        if {!$quiet} then {
          tputs $::test_channel [appendArgs \
              "---- combined connection flags are: " \
              [expr {[string length $flags] > 0 ? \
              [appendArgs \" $flags \"] : "<none>"}] \n]
        }
      }

      return $flags
    }
 
    proc getFlagsProperty { {flags ""} {quiet false} } {
      #
      # NOTE: Determine what the combined (global and local) connection
      #       flags should be, possibly quietly.
      #
      set flags [getConnectionFlags $flags $quiet]

      #
      # NOTE: If no global or local connection flags were specified, the
      #       default connection flags should be used; therefore, return
      #       an empty string in that case.
      #
      if {[string length $flags] == 0} then {
................................................................................
      if {[string length $dateTimeKind] > 0} then {
        append connection {;DateTimeKind=${dateTimeKind}}
      }

      #
      # NOTE: Figure out what the final flags for this connection need to be.
      #
      set flags [getConnectionFlags $flags $quiet]

      #
      # NOTE: If our caller specified some SQLiteConnectionFlags, add the
      #       necessary portion of the connection string now.
      #
      if {[string length $flags] > 0} then {
        append connection {;Flags=${flags}}
................................................................................
            if {![info exists ::no(deleteSqliteNativeFiles)]} then {
              if {![info exists ::no(deleteSqliteImplicitFiles)]} then {
                foreach fileName $nativeFileNames {
                  tryDeleteAssembly $fileName
                }
              }


              if {![info exists ::no(deleteSqlitePlatformFiles)] && \
                  [string length $platform] > 0} then {
                foreach fileName $nativeFileNames {
                  tryDeleteAssembly $fileName $platform
                }
              }

              if {![info exists ::no(deleteSqliteArchitectureFiles)] && \
                  [string length $architecture] > 0} then {
                foreach fileName $nativeFileNames {
                  tryDeleteAssembly $fileName $architecture

                }
              }
            }

            if {![info exists ::no(deleteSqliteManagedFiles)]} then {
              foreach fileName $managedFileNames {
                tryDeleteAssembly $fileName
................................................................................
            if {![info exists ::no(copySqliteNativeFiles)]} then {
              if {![info exists ::no(copySqliteImplicitFiles)]} then {
                foreach fileName $nativeFileNames {
                  tryCopyAssembly $fileName
                }
              }


              if {![info exists ::no(copySqlitePlatformFiles)] && \
                  [string length $platform] > 0} then {
                foreach fileName $nativeFileNames {
                  tryCopyAssembly $fileName $platform
                }
              }

              if {![info exists ::no(copySqliteArchitectureFiles)] && \
                  [string length $architecture] > 0} then {
                foreach fileName $nativeFileNames {
                  tryCopyAssembly $fileName $architecture

                }
              }
            }

            if {![info exists ::no(copySqliteManagedFiles)]} then {
              foreach fileName $managedFileNames {
                tryCopyAssembly $fileName
................................................................................
          #
          if {![info exists ::no(loadSqliteFiles)]} then {
            if {![info exists ::no(loadSqliteImplicitFiles)]} then {
              tryLoadAssembly System.Data.SQLite.dll
              tryLoadAssembly System.Data.SQLite.Linq.dll
            }


            if {![info exists ::no(loadSqlitePlatformFiles)] && \
                [string length $platform] > 0} then {
              tryLoadAssembly System.Data.SQLite.dll $platform
            }

            if {![info exists ::no(loadSqliteArchitectureFiles)] && \
                [string length $architecture] > 0} then {
              tryLoadAssembly System.Data.SQLite.dll $architecture

            }
          }

          #
          # NOTE: Skip trying to delete external files if instructed.
          #
          if {![info exists ::no(deleteSqliteExternalFiles)]} then {
................................................................................
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $architecture \
                "/System.Data.SQLite.dll\"... " [file version \
                [getBinaryFileName System.Data.SQLite.dll $architecture]] \n]
          }
        }





        set assemblies [object invoke AppDomain.CurrentDomain GetAssemblies]

        object foreach assembly $assemblies {
          if {[string match \{System.Data.SQLite* $assembly]} then {
            tputs $::test_channel [appendArgs \
                "---- found assembly: " $assembly \n]
          }
        }

        catch {
          tputs $::test_channel \
              "---- define constants for \"System.Data.SQLite\"... "

................................................................................
        #
        checkForRuntimeOption $::test_channel noPoolCounts

        #
        # NOTE: Report the resource usage prior to running any tests.
        #
        reportSQLiteResources $::test_channel























        #
        # NOTE: Show the active test constraints.
        #
        tputs $::test_channel [appendArgs "---- constraints: " \
            [formatList [lsort [getConstraints]] <none>] \n]








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





<
<
<
<
<
<
<
<







 







|
|












|







 







|







 







>
|
|
|
|
|
|

|
|
|
|
>







 







>
|
|
|
|
|
|

|
|
|
|
>







 







>
|
|
|
|

|
|
|
>







 







>
>
>
>





|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403








1404
1405
1406
1407
1408
1409
1410
....
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
....
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
....
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
....
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
....
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
....
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
....
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
        return [uplevel 1 [list \
            sql execute -execute $execute -format $format $db $sql]]
      } finally {
        cleanupDb $fileName db false false false
      }
    }
 
    proc getConnectionFlags { fileName flags {quiet false} } {
      #
      # NOTE: Figure out which database file name or connection string these
      #       connection flags will actually apply to.  This is not necessary
      #       in quiet mode because this information is only used for logging
      #       and reporting purposes.
      #
      if {!$quiet} then {
        if {[string length $fileName] > 0} then {
          set database [appendArgs "file name \"" $fileName \"]
        } elseif {[info exists ::dataSource] && \
            ![array exists ::dataSource]} then {
          set database [appendArgs "data source \"" $::dataSource \"]
        } else {
          set database <unknown>
        }
      }

      #
      # NOTE: Show (and log) the local connection flags and the associated
      #       data source or file name.
      #
      if {!$quiet} then {








        tputs $::test_channel [appendArgs \
            "---- local connection flags for " $database \
            " are: " [expr {[string length $flags] > 0 ? \
            [appendArgs \" $flags \"] : "<none>"}] \n]
      }

      #
................................................................................
        set flags [combineFlags $flags $::connection_flags]

        #
        # NOTE: Show (and log) the new effective connection flags.
        #
        if {!$quiet} then {
          tputs $::test_channel [appendArgs \
              "---- combined connection flags for " $database \
              " are: " [expr {[string length $flags] > 0 ? \
              [appendArgs \" $flags \"] : "<none>"}] \n]
        }
      }

      return $flags
    }
 
    proc getFlagsProperty { {flags ""} {quiet false} } {
      #
      # NOTE: Determine what the combined (global and local) connection
      #       flags should be, possibly quietly.
      #
      set flags [getConnectionFlags "" $flags $quiet]

      #
      # NOTE: If no global or local connection flags were specified, the
      #       default connection flags should be used; therefore, return
      #       an empty string in that case.
      #
      if {[string length $flags] == 0} then {
................................................................................
      if {[string length $dateTimeKind] > 0} then {
        append connection {;DateTimeKind=${dateTimeKind}}
      }

      #
      # NOTE: Figure out what the final flags for this connection need to be.
      #
      set flags [getConnectionFlags $fileName $flags $quiet]

      #
      # NOTE: If our caller specified some SQLiteConnectionFlags, add the
      #       necessary portion of the connection string now.
      #
      if {[string length $flags] > 0} then {
        append connection {;Flags=${flags}}
................................................................................
            if {![info exists ::no(deleteSqliteNativeFiles)]} then {
              if {![info exists ::no(deleteSqliteImplicitFiles)]} then {
                foreach fileName $nativeFileNames {
                  tryDeleteAssembly $fileName
                }
              }

              if {![info exists ::no(deleteSqliteNonImplicitFiles)]} then {
                if {![info exists ::no(deleteSqlitePlatformFiles)] && \
                    [string length $platform] > 0} then {
                  foreach fileName $nativeFileNames {
                    tryDeleteAssembly $fileName $platform
                  }
                }

                if {![info exists ::no(deleteSqliteArchitectureFiles)] && \
                    [string length $architecture] > 0} then {
                  foreach fileName $nativeFileNames {
                    tryDeleteAssembly $fileName $architecture
                  }
                }
              }
            }

            if {![info exists ::no(deleteSqliteManagedFiles)]} then {
              foreach fileName $managedFileNames {
                tryDeleteAssembly $fileName
................................................................................
            if {![info exists ::no(copySqliteNativeFiles)]} then {
              if {![info exists ::no(copySqliteImplicitFiles)]} then {
                foreach fileName $nativeFileNames {
                  tryCopyAssembly $fileName
                }
              }

              if {![info exists ::no(copySqliteNonImplicitFiles)]} then {
                if {![info exists ::no(copySqlitePlatformFiles)] && \
                    [string length $platform] > 0} then {
                  foreach fileName $nativeFileNames {
                    tryCopyAssembly $fileName $platform
                  }
                }

                if {![info exists ::no(copySqliteArchitectureFiles)] && \
                    [string length $architecture] > 0} then {
                  foreach fileName $nativeFileNames {
                    tryCopyAssembly $fileName $architecture
                  }
                }
              }
            }

            if {![info exists ::no(copySqliteManagedFiles)]} then {
              foreach fileName $managedFileNames {
                tryCopyAssembly $fileName
................................................................................
          #
          if {![info exists ::no(loadSqliteFiles)]} then {
            if {![info exists ::no(loadSqliteImplicitFiles)]} then {
              tryLoadAssembly System.Data.SQLite.dll
              tryLoadAssembly System.Data.SQLite.Linq.dll
            }

            if {![info exists ::no(loadSqliteNonImplicitFiles)]} then {
              if {![info exists ::no(loadSqlitePlatformFiles)] && \
                  [string length $platform] > 0} then {
                tryLoadAssembly System.Data.SQLite.dll $platform
              }

              if {![info exists ::no(loadSqliteArchitectureFiles)] && \
                  [string length $architecture] > 0} then {
                tryLoadAssembly System.Data.SQLite.dll $architecture
              }
            }
          }

          #
          # NOTE: Skip trying to delete external files if instructed.
          #
          if {![info exists ::no(deleteSqliteExternalFiles)]} then {
................................................................................
            tputs $::test_channel [appendArgs \
                "---- file version of \"" $architecture \
                "/System.Data.SQLite.dll\"... " [file version \
                [getBinaryFileName System.Data.SQLite.dll $architecture]] \n]
          }
        }

        #
        # NOTE: Grab the list of managed assemblies for the current process
        #       and report on the System.Data.SQLite related ones.
        #
        set assemblies [object invoke AppDomain.CurrentDomain GetAssemblies]

        object foreach assembly $assemblies {
          if {[string match \{System.Data.SQLite* $assembly]} then {
            tputs $::test_channel [appendArgs \
                "---- found loaded assembly: " $assembly \n]
          }
        }

        catch {
          tputs $::test_channel \
              "---- define constants for \"System.Data.SQLite\"... "

................................................................................
        #
        checkForRuntimeOption $::test_channel noPoolCounts

        #
        # NOTE: Report the resource usage prior to running any tests.
        #
        reportSQLiteResources $::test_channel

        #
        # NOTE: Grab the list of native modules for the current process and
        #       report on the System.Data.SQLite related ones.
        #
        set modules [object invoke \
            System.Diagnostics.Process.GetCurrentProcess Modules]

        object foreach -alias module $modules {
          set fileName [file normalize [$module FileName]]

          if {[string match -nocase */sqlite3.dll $fileName]} then {
            tputs $::test_channel [appendArgs \
                "---- found loaded SQLite native library module: " \
                $fileName \n]
          } elseif {[string match \
              -nocase */SQLite.Interop.dll $fileName]} then {
            tputs $::test_channel [appendArgs \
                "---- found loaded SQLite interop assembly module: " \
                $fileName \n]
          }
        }

        #
        # NOTE: Show the active test constraints.
        #
        tputs $::test_channel [appendArgs "---- constraints: " \
            [formatList [lsort [getConstraints]] <none>] \n]