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

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

Overview
Comment:Update Eagle script library in externals to the latest code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ada723a97c30a37448c11ab54f29737de73626c7
User & Date: mistachkin 2015-10-02 19:21:57
Context
2015-10-06
00:40
Adjust naming for things related to the new xBestIndex idxFlags field for consistency. check-in: 72714fd613 user: mistachkin tags: trunk
2015-10-02
19:21
Update Eagle script library in externals to the latest code. check-in: ada723a97c user: mistachkin tags: trunk
18:05
Correct use of 'find.exe' by the batch tools. check-in: 03db10a564 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Externals/Eagle/lib/Eagle1.0/test.eagle.

  1327   1327     }
  1328   1328   
  1329   1329     proc returnInfoScript {} {
  1330   1330       return [info script]
  1331   1331     }
  1332   1332   
  1333   1333     proc runTestPrologue {} {
         1334  +    #
         1335  +    # NOTE: Verify that the global test path variable is available.
         1336  +    #
         1337  +    if {![info exists ::test_path]} then {
         1338  +      error "cannot run test prologue, \"::test_path\" must be set"
         1339  +    }
         1340  +
  1334   1341       #
  1335   1342       # HACK: We do not want to force every third-party test suite
  1336   1343       #       to come up with a half-baked solution to finding its
  1337   1344       #       own files.
  1338   1345       #
  1339   1346       if {![info exists ::no(prologue.eagle)] && ![info exists ::path]} then {
  1340   1347         set ::path [file normalize [file dirname [info script]]]
................................................................................
  1344   1351       # NOTE: Evaluate the standard test prologue in the context of
  1345   1352       #       the caller.
  1346   1353       #
  1347   1354       uplevel 1 [list source [file join $::test_path prologue.eagle]]
  1348   1355     }
  1349   1356   
  1350   1357     proc runTestEpilogue {} {
         1358  +    #
         1359  +    # NOTE: Verify that the global test path variable is available.
         1360  +    #
         1361  +    if {![info exists ::test_path]} then {
         1362  +      error "cannot run test epilogue, \"::test_path\" must be set"
         1363  +    }
         1364  +
  1351   1365       #
  1352   1366       # NOTE: Evaluate the standard test epilogue in the context of
  1353   1367       #       the caller.
  1354   1368       #
  1355   1369       uplevel 1 [list source [file join $::test_path epilogue.eagle]]
  1356   1370   
  1357   1371       #
................................................................................
  1566   1580   
  1567   1581       set array(time,$index) [clock seconds]
  1568   1582       set array(afters,$index) [llength [after info]]
  1569   1583       set array(variables,$index) [llength [info globals]]
  1570   1584       set array(commands,$index) [llength [info commands]]
  1571   1585       set array(procedures,$index) [llength [info procs]]
  1572   1586       set array(namespaces,$index) [llength [namespace children ::]]
  1573         -    set array(files,$index) [llength [getFiles $::test_path *]]
         1587  +
         1588  +    ###########################################################################
         1589  +
         1590  +    if {[info exists ::test_path]} then {
         1591  +      set array(files,$index) [llength [getFiles $::test_path *]]
         1592  +    } else {
         1593  +      set array(files,$index) 0; # NOTE: Information not available.
         1594  +    }
         1595  +
         1596  +    ###########################################################################
         1597  +
  1574   1598       set array(temporaryFiles,$index) [llength [getFiles [getTemporaryPath] *]]
  1575   1599       set array(channels,$index) [llength [file channels]]
  1576   1600       set array(aliases,$index) [llength [interp aliases]]
  1577   1601       set array(interpreters,$index) [llength [interp slaves]]
  1578   1602       set array(environment,$index) [llength [array names env]]
  1579   1603       set array(loaded,$index) [llength [info loaded]]
  1580   1604   
................................................................................
  1693   1717   
  1694   1718       #
  1695   1719       # NOTE: Show what leaked, if anything.
  1696   1720       #
  1697   1721       set count 0; upvar 1 $statsVarName array
  1698   1722   
  1699   1723       foreach statistic $statistics {
         1724  +      if {![info exists array($statistic,after)]} then {
         1725  +        tputs $channel [appendArgs "==== \"" $fileName "\" MISSING " \
         1726  +            $statistic " AFTER\n"]
         1727  +
         1728  +        continue
         1729  +      }
         1730  +
         1731  +      if {![info exists array($statistic,before)]} then {
         1732  +        tputs $channel [appendArgs "==== \"" $fileName "\" MISSING " \
         1733  +            $statistic " BEFORE\n"]
         1734  +
         1735  +        continue
         1736  +      }
         1737  +
  1700   1738         if {$array($statistic,after) > $array($statistic,before)} then {
  1701   1739           lappend array(statistics,leaked) $statistic
  1702   1740   
  1703   1741           tputs $channel [appendArgs "==== \"" $fileName "\" LEAKED " \
  1704   1742               $statistic \n]
  1705   1743   
  1706   1744           if {[info exists array($statistic,before,list)]} then {
................................................................................
  2419   2457     proc getTestChannelOrDefault {} {
  2420   2458       if {[info exists ::test_channel]} then {
  2421   2459         return $::test_channel
  2422   2460       }
  2423   2461   
  2424   2462       return stdout; # TODO: Good default?
  2425   2463     }
         2464  +
         2465  +  proc tryVerifyTestPath {} {
         2466  +    #
         2467  +    # NOTE: If the test path variable does not exist, the directory it
         2468  +    #       points to does not exist (or is not really a directory), or
         2469  +    #       it appears to be an empty directory, return false; otherwise,
         2470  +    #       return true.
         2471  +    #
         2472  +    if {![info exists ::test_path] || \
         2473  +        ![file exists $::test_path] || \
         2474  +        ![file isdirectory $::test_path] || \
         2475  +        [llength [getFiles $::test_path *]] == 0} then {
         2476  +      return false
         2477  +    }
         2478  +
         2479  +    return true
         2480  +  }
  2426   2481   
  2427   2482     proc checkForAndSetTestPath { whatIf {quiet false} } {
  2428   2483       #
  2429   2484       # NOTE: Everything in this procedure requires access to the file system;
  2430   2485       #       therefore, it cannot be used in a stock "safe" interpreter.
  2431   2486       #
  2432   2487       if {![interp issafe] && ![info exists ::test_path]} then {
................................................................................
  2460   2515             if {!$quiet} then {
  2461   2516               tqputs [getTestChannelOrDefault] [appendArgs \
  2462   2517                   "---- checking #1 for Eagle test path at \"" \
  2463   2518                   $::test_path \"...\n]
  2464   2519             }
  2465   2520           }
  2466   2521   
  2467         -        if {[string length $base] > 0 && ($whatIf || \
  2468         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2469         -            ![file isdirectory $::test_path])} then {
         2522  +        if {[string length $base] > 0 && \
         2523  +            ($whatIf || ![tryVerifyTestPath])} then {
  2470   2524             #
  2471   2525             # NOTE: Try the source release directory structure again; this
  2472   2526             #       time, assume only the embedded script library was used.
  2473   2527             #       For this case, the final test path would be:
  2474   2528             #
  2475   2529             #           $base/Library/Tests
  2476   2530             #
................................................................................
  2479   2533             if {!$quiet} then {
  2480   2534               tqputs [getTestChannelOrDefault] [appendArgs \
  2481   2535                   "---- checking #2 for Eagle test path at \"" \
  2482   2536                   $::test_path \"...\n]
  2483   2537             }
  2484   2538           }
  2485   2539   
  2486         -        if {[string length $script] > 0 && ($whatIf || \
  2487         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2488         -            ![file isdirectory $::test_path])} then {
         2540  +        if {[string length $script] > 0 && \
         2541  +            ($whatIf || ![tryVerifyTestPath])} then {
  2489   2542             #
  2490   2543             # NOTE: Try for the test package directory.  For this case, the
  2491   2544             #       final test path would be:
  2492   2545             #
  2493   2546             #           $script/../Test1.0
  2494   2547             #
  2495   2548             set ::test_path [file normalize [file join [file dirname [file \
................................................................................
  2498   2551             if {!$quiet} then {
  2499   2552               tqputs [getTestChannelOrDefault] [appendArgs \
  2500   2553                   "---- checking #3 for Eagle test path at \"" \
  2501   2554                   $::test_path \"...\n]
  2502   2555             }
  2503   2556           }
  2504   2557   
  2505         -        if {[string length $base] > 0 && ($whatIf || \
  2506         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2507         -            ![file isdirectory $::test_path])} then {
         2558  +        if {[string length $base] > 0 && \
         2559  +            ($whatIf || ![tryVerifyTestPath])} then {
  2508   2560             #
  2509   2561             # NOTE: Try for the test package directory again; this time, use
  2510   2562             #       the base path and assume the source release directory
  2511   2563             #       structure.  For this case, the final test path would be:
  2512   2564             #
  2513   2565             #           $base/lib/Test1.0
  2514   2566             #
................................................................................
  2518   2570             if {!$quiet} then {
  2519   2571               tqputs [getTestChannelOrDefault] [appendArgs \
  2520   2572                   "---- checking #4 for Eagle test path at \"" \
  2521   2573                   $::test_path \"...\n]
  2522   2574             }
  2523   2575           }
  2524   2576   
  2525         -        if {[string length $base] > 0 && ($whatIf || \
  2526         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2527         -            ![file isdirectory $::test_path])} then {
         2577  +        if {[string length $base] > 0 && \
         2578  +            ($whatIf || ![tryVerifyTestPath])} then {
  2528   2579             #
  2529   2580             # NOTE: Try for the test package directory again; this time, use
  2530   2581             #       the base path.  For this case, the final test path would
  2531   2582             #       be:
  2532   2583             #
  2533   2584             #           $base/Test1.0
  2534   2585             #
................................................................................
  2538   2589             if {!$quiet} then {
  2539   2590               tqputs [getTestChannelOrDefault] [appendArgs \
  2540   2591                   "---- checking #5 for Eagle test path at \"" \
  2541   2592                   $::test_path \"...\n]
  2542   2593             }
  2543   2594           }
  2544   2595   
  2545         -        if {[string length $library] > 0 && ($whatIf || \
  2546         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2547         -            ![file isdirectory $::test_path])} then {
         2596  +        if {[string length $library] > 0 && \
         2597  +            ($whatIf || ![tryVerifyTestPath])} then {
  2548   2598             #
  2549   2599             # NOTE: This must be a binary release, no "Library" directory
  2550   2600             #       then.  Also, binary releases have an upper-case "Tests"
  2551   2601             #       directory name that originates from the "update.bat"
  2552   2602             #       tool.  This must match the casing used in "update.bat".
  2553   2603             #       For this case, the final test path would be:
  2554   2604             #
................................................................................
  2560   2610             if {!$quiet} then {
  2561   2611               tqputs [getTestChannelOrDefault] [appendArgs \
  2562   2612                   "---- checking #6 for Eagle test path at \"" \
  2563   2613                   $::test_path \"...\n]
  2564   2614             }
  2565   2615           }
  2566   2616   
  2567         -        if {[string length $base] > 0 && ($whatIf || \
  2568         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2569         -            ![file isdirectory $::test_path])} then {
         2617  +        if {[string length $base] > 0 && \
         2618  +            ($whatIf || ![tryVerifyTestPath])} then {
  2570   2619             #
  2571   2620             # NOTE: Fallback to using the base directory and checking for a
  2572   2621             #       "Tests" directory beneath it.  For this case, the final
  2573   2622             #       test path would be:
  2574   2623             #
  2575   2624             #           $base/Tests
  2576   2625             #
................................................................................
  2603   2652             if {!$quiet} then {
  2604   2653               tqputs [getTestChannelOrDefault] [appendArgs \
  2605   2654                   "---- checking #1 for Tcl test path at \"" \
  2606   2655                   $::test_path \"...\n]
  2607   2656             }
  2608   2657           }
  2609   2658   
  2610         -        if {[string length $script] > 0 && ($whatIf || \
  2611         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2612         -            ![file isdirectory $::test_path])} then {
         2659  +        if {[string length $script] > 0 && \
         2660  +            ($whatIf || ![tryVerifyTestPath])} then {
  2613   2661             #
  2614   2662             # NOTE: Try for the test package directory.  For this case, the
  2615   2663             #       final test path would be:
  2616   2664             #
  2617   2665             #           $script/../Test1.0
  2618   2666             #
  2619   2667             set ::test_path [file normalize [file join [file dirname [file \
................................................................................
  2622   2670             if {!$quiet} then {
  2623   2671               tqputs [getTestChannelOrDefault] [appendArgs \
  2624   2672                   "---- checking #2 for Tcl test path at \"" \
  2625   2673                   $::test_path \"...\n]
  2626   2674             }
  2627   2675           }
  2628   2676   
  2629         -        if {[string length $script] > 0 && ($whatIf || \
  2630         -            ![info exists ::test_path] || ![file exists $::test_path] || \
  2631         -            ![file isdirectory $::test_path])} then {
         2677  +        if {[string length $script] > 0 && \
         2678  +            ($whatIf || ![tryVerifyTestPath])} then {
  2632   2679             #
  2633   2680             # NOTE: This must be a binary release, no "Library" directory
  2634   2681             #       then.  Also, binary releases have an upper-case "Tests"
  2635   2682             #       directory name that originates from the "update.bat"
  2636   2683             #       tool.  This must match the casing used in "update.bat".
  2637   2684             #       For this case, the final test path would be:
  2638   2685             #
................................................................................
  3560   3607           execTestShell isRandomOrder isBreakOnLeak isStopOnFailure \
  3561   3608           isStopOnLeak isExitOnComplete returnInfoScript runTestPrologue \
  3562   3609           runTestEpilogue hookPuts unhookPuts runTest testDebugBreak \
  3563   3610           testArrayGet testShim tsource recordTestStatistics \
  3564   3611           reportTestStatistics formatList formatListAsDict pathToRegexp \
  3565   3612           inverseLsearchGlob removePathFromFileNames formatDecimal \
  3566   3613           clearTestPercent reportTestPercent runAllTests isTestSuiteRunning \
  3567         -        getTestChannelOrDefault checkForAndSetTestPath configureTcltest \
  3568         -        machineToPlatform getPassPercentage getSkipPercentage] false false
         3614  +        getTestChannelOrDefault tryVerifyTestPath checkForAndSetTestPath \
         3615  +        configureTcltest machineToPlatform getPassPercentage \
         3616  +        getSkipPercentage] false false
  3569   3617   
  3570   3618       ###########################################################################
  3571   3619       ############################## END Tcl ONLY ###############################
  3572   3620       ###########################################################################
  3573   3621     }
  3574   3622   
  3575   3623     #
  3576   3624     # NOTE: Provide the Eagle test package to the interpreter.
  3577   3625     #
  3578   3626     package provide Eagle.Test \
  3579   3627       [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}]
  3580   3628   }
  3581   3629   

Changes to Externals/Eagle/lib/Test1.0/all.eagle.

    46     46     set test_all_path \
    47     47         [file normalize [file dirname [info script]]]
    48     48   }
    49     49   
    50     50   source [file join $test_all_path prologue.eagle]
    51     51   
    52     52   if {![info exists test_path]} then {
           53  +  #
           54  +  # NOTE: Build a reusable expression that can be used to verify the
           55  +  #       candidate paths.  This is done to avoid duplication of this
           56  +  #       (quite complex) expression several times (just below).
           57  +  #
           58  +  set expr {![info exists test_path] || ![file exists $test_path] || \
           59  +      ![file isdirectory $test_path] || ([llength [info commands \
           60  +      glob]] > 0 && [llength [glob -directory $test_path -types {f r} \
           61  +      -nocomplain -- *]] == 0)}
           62  +
    53     63     #
    54     64     # NOTE: Search for the "Library/Tests" -OR- "Tests" sub-directories
    55     65     #       within the sub-directory one level up and then two levels up
    56     66     #       from the sub-directory containing the "all.eagle" file from
    57     67     #       the test suite package.
    58     68     #
    59         -  set test_path [file normalize [file join [file dirname \
    60         -      $test_all_path] Library Tests]]
           69  +  set test_path [file normalize \
           70  +      [file join [file dirname $test_all_path] Library Tests]]
           71  +
           72  +  if {[expr $expr]} then {
           73  +    set test_path [file normalize \
           74  +        [file join [file dirname [file dirname $test_all_path]] \
           75  +        Library Tests]]
           76  +  }
    61     77   
    62         -  if {![file exists $test_path] || ![file isdirectory $test_path]} then {
    63         -    set test_path [file normalize [file join [file dirname \
    64         -        [file dirname $test_all_path]] Library Tests]]
           78  +  if {[expr $expr]} then {
           79  +    set test_path [file normalize \
           80  +        [file join [file dirname $test_all_path] Tests]]
    65     81     }
    66     82   
    67         -  if {![file exists $test_path] || ![file isdirectory $test_path]} then {
    68         -    set test_path [file normalize [file join [file dirname \
    69         -        $test_all_path] Tests]]
           83  +  if {[expr $expr]} then {
           84  +    set test_path [file normalize \
           85  +        [file join [file dirname [file dirname $test_all_path]] \
           86  +        Tests]]
    70     87     }
    71     88   
    72         -  if {![file exists $test_path] || ![file isdirectory $test_path]} then {
    73         -    set test_path [file normalize [file join [file dirname \
    74         -        [file dirname $test_all_path]] Tests]]
    75         -  }
           89  +  unset expr
    76     90   }
    77     91   
    78     92   set no(prologue.eagle) true
    79     93   set no(epilogue.eagle) true
    80     94   
    81     95   set test_time [time {
    82     96     runAllTests $test_channel $test_path \

Changes to Externals/Eagle/lib/Test1.0/prologue.eagle.

    18     18     if {[info level] > 0} then {
    19     19       error "cannot run, current level is not global"
    20     20     }
    21     21   
    22     22     #
    23     23     # NOTE: Make sure all the variables used by this prologue are unset.
    24     24     #
    25         -  unset -nocomplain pkg_dir pattern dummy directory name value exec encoding \
    26         -      host memory stack drive server database timeout user password percent \
    27         -      checkout timeStamp loaded
           25  +  unset -nocomplain expr pkg_dir pattern dummy directory name value \
           26  +      exec encoding host memory stack drive server database timeout \
           27  +      user password percent checkout timeStamp loaded
    28     28   
    29     29     #
    30     30     # NOTE: Indicate that the test suite is currently running.
    31     31     #
    32     32     if {![info exists test_suite_running] || !$test_suite_running} then {
    33     33       set test_suite_running true
    34     34     }
................................................................................
    40     40       set test_all_path [file normalize [file dirname [info script]]]
    41     41     }
    42     42   
    43     43     #
    44     44     # NOTE: Set the location of the test suite, if necessary.
    45     45     #
    46     46     if {![info exists test_path]} then {
           47  +    #
           48  +    # NOTE: Build a reusable expression that can be used to verify the
           49  +    #       candidate paths.  This is done to avoid duplication of this
           50  +    #       (quite complex) expression several times (just below).
           51  +    #
           52  +    set expr {![info exists test_path] || ![file exists $test_path] || \
           53  +        ![file isdirectory $test_path] || ([llength [info commands \
           54  +        glob]] > 0 && [llength [glob -directory $test_path -types {f r} \
           55  +        -nocomplain -- *]] == 0)}
           56  +
    47     57       #
    48     58       # NOTE: Search for the "Library/Tests" -OR- "Tests" sub-directories
    49     59       #       within the sub-directory one level up and then two levels up
    50     60       #       from the sub-directory containing the "all.eagle" file from
    51     61       #       the test suite package.
    52     62       #
    53         -    set test_path [file normalize [file join [file dirname \
    54         -        $test_all_path] Library Tests]]
           63  +    set test_path [file normalize \
           64  +        [file join [file dirname $test_all_path] Library Tests]]
    55     65   
    56         -    if {![file exists $test_path] || ![file isdirectory $test_path]} then {
    57         -      set test_path [file normalize [file join [file dirname \
    58         -          [file dirname $test_all_path]] Library Tests]]
           66  +    if {[expr $expr]} then {
           67  +      set test_path [file normalize \
           68  +          [file join [file dirname [file dirname $test_all_path]] \
           69  +          Library Tests]]
    59     70       }
    60     71   
    61         -    if {![file exists $test_path] || ![file isdirectory $test_path]} then {
    62         -      set test_path [file normalize [file join [file dirname \
    63         -          $test_all_path] Tests]]
           72  +    if {[expr $expr]} then {
           73  +      set test_path [file normalize \
           74  +          [file join [file dirname $test_all_path] Tests]]
    64     75       }
    65     76   
    66         -    if {![file exists $test_path] || ![file isdirectory $test_path]} then {
    67         -      set test_path [file normalize [file join [file dirname \
    68         -          [file dirname $test_all_path]] Tests]]
           77  +    if {[expr $expr]} then {
           78  +      set test_path [file normalize \
           79  +          [file join [file dirname [file dirname $test_all_path]] \
           80  +          Tests]]
    69     81       }
           82  +
           83  +    unset expr
    70     84     }
    71     85   
    72     86     #
    73     87     # NOTE: Set the location of the test suite data, if necessary.
    74     88     #
    75     89     if {![info exists test_data_path]} then {
    76     90       set test_data_path [file join $test_path data]