System.Data.SQLite
Check-in [90e981ea2d]
Not logged in

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

Overview
Comment:Use save/restore semantics for environment variables modified by the test suite infrastructure.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 90e981ea2de5c1dd539f839149e91813f17a5ff0
User & Date: mistachkin 2015-12-20 07:13:48
Context
2015-12-31
22:58
Merge fix for [5251bd0878]. Update SQLite core library to the latest trunk code. Bump version to 1.0.100.0. Update version history docs. check-in: 59a224a9cf user: mistachkin tags: trunk
22:50
Merge fix for [5251bd0878]. Update SQLite core library to the latest trunk code. Bump version to 1.0.100.0. Update version history docs. check-in: 9f0c9b796f user: mistachkin tags: updates
2015-12-20
07:13
Use save/restore semantics for environment variables modified by the test suite infrastructure. check-in: 90e981ea2d user: mistachkin tags: trunk
07:13
Stop leaking the 'savedEnv' script variable in tests 'data-1.68' and 'data-1.69'. check-in: 90e0d6df11 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

2333
2334
2335
2336
2337
2338
2339
2340






























































2341
2342
2343
2344








2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
....
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
        # NOTE: The file does not exist, success!
        #
        set code 0
      }

      return $code
    }
 






























































    proc setupDbInterruptCallback { channel log } {
      tputs $channel "---- setting up debugger interrupt callback... "

      if {[catch {








        set ::env(quietFindInterpreterTestPath) 1
        set ::env(quietSetupInterpreterTestPath) 1

        try {
          #
          # NOTE: Make sure the script debugger and the isolated interpreter
          #       are setup and ready for use.
          #
          debug setup true true

          #
................................................................................
                tputs $::test_channel [appendArgs \n \
                    "==== WARNING: cannot cancel any queries: " \
                    "the \"object\" command is not available\n"]
              }
            }
          }}
        } finally {
          catch {unset ::env(quietSetupInterpreterTestPath)}
          catch {unset ::env(quietFindInterpreterTestPath)}
        }
      } error] == 0} then {
        addConstraint interruptCallback.sqlite3

        tputs $channel yes\n
      } else {
        tputs $channel [appendArgs "no, error: " \n\t $error \n]








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




>
>
>
>
>
>
>
>
|
|

<







 







|
|







2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417

2418
2419
2420
2421
2422
2423
2424
....
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
        # NOTE: The file does not exist, success!
        #
        set code 0
      }

      return $code
    }
 
    proc saveEnvironmentVariables { names {varName ""} } {
      #
      # NOTE: For each name, does the live environment variable exist?  If
      #       so, save the value for later; otherwise, make sure the saved
      #       value does not exist either.  The live environment variables
      #       ARE NOT changed by this procedure.
      #
      if {[string length $varName] == 0} then {
        set varName savedEnv
      }

      upvar 1 $varName savedEnv

      foreach name $names {
        if {[info exists ::env($name)]} then {
          set savedEnv($name) $::env($name)
        } else {
          unset -nocomplain savedEnv($name)
        }
      }

      #
      # NOTE: This is self-cleaning.  If no saved environment variables now
      #       exist, remove the array.
      #
      if {[array size savedEnv] == 0} then {
        unset -nocomplain savedEnv
      }
    }
 
    proc restoreEnvironmentVariables { names {varName ""} } {
      #
      # NOTE: For each name, does the saved environment variable exist?  If
      #       so, restore the saved value and unset it; otherwise, make sure
      #       the live environment variable does not exist either (i.e. it
      #       was not set to begin with).  Both saved and live environment
      #       variables ARE changed by this procedure.
      #
      if {[string length $varName] == 0} then {
        set varName savedEnv
      }

      upvar 1 $varName savedEnv

      foreach name $names {
        if {[info exists savedEnv($name)]} then {
          set ::env($name) $savedEnv($name)
          unset -nocomplain savedEnv($name)
        } else {
          unset -nocomplain ::env($name)
        }
      }

      #
      # NOTE: This is self-cleaning.  If no saved environment variables now
      #       exist, remove the array.
      #
      if {[array size savedEnv] == 0} then {
        unset -nocomplain savedEnv
      }
    }
 
    proc setupDbInterruptCallback { channel log } {
      tputs $channel "---- setting up debugger interrupt callback... "

      if {[catch {
        saveEnvironmentVariables [list \
            quietFindInterpreterTestPath quietSetupInterpreterTestPath]

        try {
          #
          # NOTE: Prevent the vendor script from being noisy when creating
          #       the isolated interpreter.
          #
          set ::env(quietFindInterpreterTestPath) 1
          set ::env(quietSetupInterpreterTestPath) 1


          #
          # NOTE: Make sure the script debugger and the isolated interpreter
          #       are setup and ready for use.
          #
          debug setup true true

          #
................................................................................
                tputs $::test_channel [appendArgs \n \
                    "==== WARNING: cannot cancel any queries: " \
                    "the \"object\" command is not available\n"]
              }
            }
          }}
        } finally {
          restoreEnvironmentVariables [list \
              quietFindInterpreterTestPath quietSetupInterpreterTestPath]
        }
      } error] == 0} then {
        addConstraint interruptCallback.sqlite3

        tputs $channel yes\n
      } else {
        tputs $channel [appendArgs "no, error: " \n\t $error \n]