System.Data.SQLite
Check-in [04d60edbdf]
Not logged in

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

Overview
Comment:Fixes to the new SQLiteLog initialization handling and associated test suite infrastructure updates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 04d60edbdf689fe4f0f865dcc5ce336c929bbb71
User & Date: mistachkin 2018-07-26 07:24:50
Context
2018-07-26
07:56
More reform to the logging subsystem. Move interop log callback into the SQLiteLog class. check-in: 4a9980ac1d user: mistachkin tags: trunk
07:24
Fixes to the new SQLiteLog initialization handling and associated test suite infrastructure updates. check-in: 04d60edbdf user: mistachkin tags: trunk
06:54
Add configuration suffix support to the test suite infrastructure. check-in: 7ffb245069 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteLog.cs.

   149    149               //       taken, including calling a P/Invoke (interop) method;
   150    150               //       therefore, by default, attempt to perform these steps
   151    151               //       once.
   152    152               //
   153    153               if (UnsafeNativeMethods.GetSettingValue(
   154    154                       "Initialize_SQLiteLog", null) == null)
   155    155               {
   156         -                try
   157         -                {
   158         -                    if (Interlocked.Increment(ref _attemptedInitialize) > 0)
   159         -                    {
   160         -                        return;
   161         -                    }
   162         -                }
   163         -                finally
          156  +                if (Interlocked.Increment(ref _attemptedInitialize) > 1)
   164    157                   {
   165    158                       Interlocked.Decrement(ref _attemptedInitialize);
          159  +                    return;
   166    160                   }
   167    161               }
   168    162   
   169    163               //
   170    164               // BUFXIX: We cannot initialize the logging interface if the SQLite
   171    165               //         core library has already been initialized anywhere in
   172    166               //         the process (see ticket [2ce0870fad]).

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

  4469   4469   
  4470   4470       proc runSQLiteTestPrologue {} {
  4471   4471         #
  4472   4472         # NOTE: Skip running our custom prologue if the main one has been
  4473   4473         #       skipped.
  4474   4474         #
  4475   4475         if {![info exists ::no(prologue.eagle)]} then {
         4476  +        #
         4477  +        # NOTE: Save the environment variables that we intend to change for
         4478  +        #       the test suite.
         4479  +        #
         4480  +        saveEnvironmentVariables \
         4481  +            [list Initialize_SQLiteLog] ::testSuiteSavedEnv
         4482  +
         4483  +        #
         4484  +        # NOTE: Force the managed logging subsystem to attempt to initialize
         4485  +        #       itself more than once.
         4486  +        #
         4487  +        set ::env(Initialize_SQLiteLog) 1
         4488  +
  4476   4489           #
  4477   4490           # NOTE: Load the "before-constraints" custom per-user and/or per-host
  4478   4491           #       test settings now.
  4479   4492           #
  4480   4493           uplevel 1 [list loadSQLiteTestSettings $::test_channel .before]
  4481   4494   
  4482   4495           #
................................................................................
  5681   5694   
  5682   5695           #
  5683   5696           # NOTE: If necessary, disable shared-cache mode now.
  5684   5697           #
  5685   5698           if {[hasRuntimeOption sharedCache]} then {
  5686   5699             enableSharedCache $::test_channel false
  5687   5700           }
         5701  +
         5702  +        #
         5703  +        # NOTE: Restore the previously saved environment variables that we
         5704  +        #       changed for the test suite.
         5705  +        #
         5706  +        restoreEnvironmentVariables \
         5707  +            [list Initialize_SQLiteLog] ::testSuiteSavedEnv
  5688   5708         }
  5689   5709       }
  5690   5710   
  5691   5711       ###########################################################################
  5692   5712       ############################# END Eagle ONLY ##############################
  5693   5713       ###########################################################################
  5694   5714     }