Index: Externals/Eagle/lib/Eagle1.0/test.eagle ================================================================== --- Externals/Eagle/lib/Eagle1.0/test.eagle +++ Externals/Eagle/lib/Eagle1.0/test.eagle @@ -386,12 +386,12 @@ # # TODO: Add more support for standard tcltest options here. # set options [list -configuration -constraints -exitOnComplete -file \ - -logFile -match -no -notFile -postTest -preTest -skip -stopOnFailure \ - -suffix -tclsh -threshold] + -logFile -machine -match -no -notFile -platform -postTest -preTest \ + -skip -stopOnFailure -suffix -tclsh -threshold] foreach {name value} $args { # # NOTE: Use the [tqputs] command here just in case the test log file # has not been setup yet (i.e. by default, this procedure is @@ -488,14 +488,22 @@ } } proc getFiles { directory pattern } { if {[isEagle]} then { - return [lsort -dictionary [file list $directory $pattern]] + set result [list] + + foreach fileName [lsort -dictionary [file list $directory $pattern]] { + if {[file isfile $fileName] && [file readable $fileName]} then { + lappend result $fileName + } + } + + return $result } else { return [lsort -dictionary [glob -directory $directory -types \ - {b c f p s} -nocomplain -- $pattern]] + {f r} -nocomplain -- $pattern]] } } proc getTestFiles { directories matchFilePatterns skipFilePatterns } { set result [list] @@ -1267,23 +1275,10 @@ # # NOTE: We evaluated another test file. # incr count - # - # NOTE: In terms of files, not tests, what percent done are we now? - # - set percent [formatDecimal \ - [expr {$total != 0 ? 100.0 * ($count / double($total)) : 100}]] - - if {$percent != $lastPercent} then { - reportTestPercent $channel $percent \ - [llength $failed] [llength $leaked] - - set lastPercent $percent - } - # # NOTE: Record failed test count after this file. # if {[isEagle]} then { set after $::eagle_tests(failed) @@ -1295,10 +1290,23 @@ # NOTE: Did this file have any failing tests? # if {$after > $before} then { lappend failed [file tail $fileName] } + + # + # NOTE: In terms of files, not tests, what percent done are we now? + # + set percent [formatDecimal \ + [expr {$total != 0 ? 100.0 * ($count / double($total)) : 100}]] + + if {$percent != $lastPercent} then { + reportTestPercent $channel $percent \ + [llength $failed] [llength $leaked] + + set lastPercent $percent + } # # NOTE: Unset the current test file name, it is no longer # needed. # @@ -1773,10 +1781,78 @@ proc getTkVersion {} { return [testExecTclScript { puts -nonewline stdout [package require Tk]; exit }] } + + proc getTestMachine {} { + # + # NOTE: Determine the effective test machine and return it. If the + # test machine cannot be determined, return an empty string. + # + if {[info exists ::test_flags(-machine)] && \ + [string length $::test_flags(-machine)] > 0} then { + # + # NOTE: The test machine has been manually overridden via the test + # flags; therefore, use it. + # + return $::test_flags(-machine) + } elseif {[info exists ::test_machine]} then { + # + # NOTE: Use the test machine. The default value is set by the test + # suite prologue; however, this may have been overridden. + # + return $::test_machine + } elseif {[info exists ::tcl_platform(machine)]} then { + # + # NOTE: Use the build machine of Eagle itself. + # + return $::tcl_platform(machine) + } else { + # + # NOTE: We are missing the machine, return nothing. + # + return "" + } + } + + proc getTestPlatform {} { + # + # NOTE: Determine the effective test platform and return it. If the + # test platform cannot be determined, return an empty string. + # + if {[info exists ::test_flags(-platform)] && \ + [string length $::test_flags(-platform)] > 0} then { + # + # NOTE: The test platform has been manually overridden via the test + # flags; therefore, use it. + # + return $::test_flags(-platform) + } elseif {[info exists ::test_platform]} then { + # + # NOTE: Use the test platform. The default value is set by the test + # suite prologue; however, this may have been overridden. + # + return $::test_platform + } else { + set machine [getTestMachine] + + if {[string length $machine] > 0} then { + # + # NOTE: Use the machine architecture to figure out the platform + # and then return it. + # + return [machineToPlatform $machine] + } else { + # + # NOTE: We are missing the machine and we cannot figure out the + # platform without it; therefore, return nothing. + # + return "" + } + } + } proc getTestConfiguration {} { # # NOTE: Determine the effective test configuration and return it. If # the test configuration cannot be determined, return an empty @@ -1789,19 +1865,18 @@ # test flags; therefore, use it. # return $::test_flags(-configuration) } elseif {[info exists ::test_configuration]} then { # - # NOTE: Use the test configuration. The default value is "Release", - # as set by the test suite prologue; however, this may have - # been overridden. + # NOTE: Use the test configuration. The default value is set by the + # test suite prologue; however, this may have been overridden. # return $::test_configuration } elseif {[info exists ::eagle_platform(configuration)]} then { # # NOTE: Use the build configuration of Eagle itself. This value will - # always be "Debug" or "Release". + # most likely be either "Debug" or "Release". # return $::eagle_platform(configuration) } else { # # NOTE: We are missing the configuration, return nothing. @@ -2065,19 +2140,23 @@ # # NOTE: We need several of our test related commands in the global # namespace as well. # - exportAndImportPackageCommands [namespace current] [list addConstraint \ - calculateRelativePerformance haveConstraint haveOrAddConstraint \ - processTestArguments getTemporaryPath getTestLog getTestLogId getFiles \ - getConstraints getTestFiles getTestRunId execTestShell runTestPrologue \ - runTestEpilogue runTest runAllTests fixConstraints sourceIfValid \ - isExitOnComplete getPassPercentage getSkipPercentage testExec tlog \ - returnInfoScript tputs formatDecimal formatList configureTcltest \ - calculateBogoCops removeConstraint machineToPlatform tsource testShim \ - getTestConfiguration getTestSuffix getTclShellFileName] false false + exportAndImportPackageCommands [namespace current] [list \ + tputs tlog getSoftwareRegistryKey haveConstraint addConstraint \ + haveOrAddConstraint getConstraints removeConstraint fixConstraints \ + calculateBogoCops calculateRelativePerformance sourceIfValid \ + processTestArguments getTclShellFileName getTemporaryPath getFiles \ + getTestFiles getTestRunId getTestLogId getTestLog testExec \ + testClrExec execTestShell isStopOnFailure isExitOnComplete \ + returnInfoScript runTestPrologue runTestEpilogue hookPuts unhookPuts \ + runTest testShim tsource recordTestStatistics reportTestStatistics \ + formatList formatListAsDict pathToRegexp inverseLsearchGlob \ + removePathFromFileNames formatDecimal clearTestPercent \ + reportTestPercent runAllTests configureTcltest machineToPlatform \ + getPassPercentage getSkipPercentage] false false ########################################################################### ############################## END Tcl ONLY ############################### ########################################################################### } Index: Externals/Eagle/lib/Eagle1.0/vendor.eagle ================================================================== --- Externals/Eagle/lib/Eagle1.0/vendor.eagle +++ Externals/Eagle/lib/Eagle1.0/vendor.eagle @@ -183,11 +183,12 @@ # checkForTestOverrides stdout [expr {[info exists test_overrides] ? \ $test_overrides : [list binary_directory build_base_directory \ build_directory common_directory connection_flags database_directory \ datetime_format scratch_directory temporary_directory \ - test_configuration test_constraints test_overrides test_year \ + test_configuration test_configurations test_constraints \ + test_machine test_overrides test_platform test_year test_years \ test_year_clr_v2 test_year_clr_v4 vendor_directory]}] false # # NOTE: This variable will contain the name of the directory containing the # vendor-specific testing infrastructure. If the variable does not Index: Externals/Eagle/lib/Test1.0/constraints.eagle ================================================================== --- Externals/Eagle/lib/Test1.0/constraints.eagle +++ Externals/Eagle/lib/Test1.0/constraints.eagle @@ -18,10 +18,21 @@ # NOTE: Use our own namespace here because even though we do not directly # support namespaces ourselves, we do not want to pollute the global # namespace if this script actually ends up being evaluated in Tcl. # namespace eval ::Eagle { + proc getKnownMonoVersions {} { + # + # NOTE: This job of this procedure is to return the list of "known" + # versions of Mono supported by the test suite infrastructure. + # + return [list \ + [list 2 0] [list 2 2] [list 2 4] [list 2 6] [list 2 8] [list 2 10] \ + [list 2 11] [list 2 12] [list 3 0] [list 3 1] [list 3 2] [list 3 3] \ + [list 3 4] [list 3 5] [list 3 6]] + } + proc checkForPlatform { channel } { tputs $channel "---- checking for platform... " if {[info exists ::tcl_platform(platform)]} then { addConstraint $::tcl_platform(platform) @@ -42,14 +53,16 @@ # # NOTE: Add the necessary constraints for each version of Mono that # we know about. # - foreach version [list 20 22 24 26 28 210 211 212 30] { - addConstraint [appendArgs monoToDo $version] - addConstraint [appendArgs monoBug $version] - addConstraint [appendArgs monoCrash $version] + foreach monoVersion [getKnownMonoVersions] { + set constraintVersion [join $monoVersion ""] + + addConstraint [appendArgs monoToDo $constraintVersion] + addConstraint [appendArgs monoBug $constraintVersion] + addConstraint [appendArgs monoCrash $constraintVersion] } # # NOTE: Also add just the generic Mono constraints that do not have # a trailing version. @@ -594,10 +607,36 @@ tputs $channel yes\n } else { tputs $channel no\n } } + + proc checkForTestMachine { channel } { + tputs $channel "---- checking for test machine... " + + if {[info exists ::test_machine] && \ + [string length $::test_machine] > 0} then { + addConstraint [appendArgs machine. $::test_machine] + + tputs $channel [appendArgs $::test_machine \n] + } else { + tputs $channel unknown\n + } + } + + proc checkForTestPlatform { channel } { + tputs $channel "---- checking for test platform... " + + if {[info exists ::test_platform] && \ + [string length $::test_platform] > 0} then { + addConstraint [appendArgs platform. $::test_platform] + + tputs $channel [appendArgs $::test_platform \n] + } else { + tputs $channel unknown\n + } + } proc checkForTestConfiguration { channel } { tputs $channel "---- checking for test configuration... " if {[info exists ::test_configuration] && \ @@ -1201,11 +1240,13 @@ # # NOTE: Save the list of managed debugging assistants for # later use by the test suite. # - set ::test_mdas $names + if {![info exists ::no(setMdas)]} then { + set ::test_mdas $names + } # # NOTE: Yes, it appears that at least one managed debugging # assistant is enabled. # @@ -1396,10 +1437,42 @@ " " ( $dotVersion ) \n] } else { tputs $channel no\n } } + + proc checkForFrameworkVersion { channel } { + tputs $channel "---- checking for framework version... " + + if {[info exists ::eagle_platform(frameworkVersion)] && \ + [string length $::eagle_platform(frameworkVersion)] > 0} then { + # + # NOTE: Get the major and minor portions of the version only. + # + set dotVersion [join [lrange [split \ + $::eagle_platform(frameworkVersion) .] 0 1] .] + + # + # NOTE: Now create a version string for use in the constraint name + # (remove the periods). + # + set version [string map [list . ""] $dotVersion] + + # + # NOTE: If the framework version was found, add a test constraint + # for it now. + # + if {[string length $version] > 0} then { + addConstraint [appendArgs framework $version] + } + + tputs $channel [appendArgs $::eagle_platform(frameworkVersion) \ + " " ( $dotVersion ) \n] + } else { + tputs $channel no\n + } + } proc checkForRuntimeVersion { channel } { tputs $channel "---- checking for runtime version... " if {[info exists ::eagle_platform(runtimeVersion)] && \ @@ -1415,124 +1488,95 @@ # (remove the periods). # set version [string map [list . ""] $dotVersion] if {[isMono]} then { + # + # NOTE: If the runtime version was found, add a test constraint + # for it now. + # if {[string length $version] > 0} then { # # NOTE: We are running on Mono. Keep track of the specific # version for usage in test constraints. # addConstraint [appendArgs mono $version] - } - - if {[string length $dotVersion] > 0 && \ - [regexp -- {^(\d+)\.(\d+)$} $dotVersion dummy \ - majorVersion minorVersion]} then { - set monoVersions [list] - - # - # NOTE: Check for any Mono version 2.x or higher. - # - if {$majorVersion >= 2} then { - # - # NOTE: Check for any Mono version higher than 2.0. - # - if {$majorVersion > 2 || $minorVersion > 0} then { - lappend monoVersions 20 - } - - # - # NOTE: Check for any Mono version higher than 2.2. - # - if {$majorVersion > 2 || $minorVersion > 2} then { - lappend monoVersions 22 - } - - # - # NOTE: Check for any Mono version higher than 2.4. - # - if {$majorVersion > 2 || $minorVersion > 4} then { - lappend monoVersions 24 - } - - # - # NOTE: Check for any Mono version higher than 2.6. - # - if {$majorVersion > 2 || $minorVersion > 6} then { - lappend monoVersions 26 - } - - # - # NOTE: Check for any Mono version higher than 2.8. - # - if {$majorVersion > 2 || $minorVersion > 8} then { - lappend monoVersions 28 - } - - # - # NOTE: Check for any Mono version higher than 2.10. - # - if {$majorVersion > 2 || $minorVersion > 10} then { - lappend monoVersions 210 - } - - # - # NOTE: Check for any Mono version higher than 2.11. - # - if {$majorVersion > 2 || $minorVersion > 11} then { - lappend monoVersions 211 - } - - # - # NOTE: Check for any Mono version higher than 2.12. - # - if {$majorVersion > 2 || $minorVersion > 12} then { - lappend monoVersions 212 - } - } - - # - # NOTE: Check for any Mono version 3.x or higher. - # - if {$majorVersion >= 3} then { - # - # NOTE: Check for any Mono version higher than 3.0. - # - if {$majorVersion > 3 || $minorVersion > 0} then { - lappend monoVersions 30 - } - } - - # - # NOTE: Add the necessary constraints for each version of Mono we - # should NOT skip bugs for. - # - foreach monoVersion $monoVersions { - addConstraint [appendArgs monoToDo $monoVersion] - addConstraint [appendArgs monoBug $monoVersion] - addConstraint [appendArgs monoCrash $monoVersion] - } - } - } else { + addConstraint [appendArgs mono $version OrHigher] + } + + # + # NOTE: Attempt to parse the version into its major and minor + # components. + # + if {[string length $dotVersion] > 0 && [regexp -- {^(\d+)\.(\d+)$} \ + $dotVersion dummy majorVersion minorVersion]} then { + # + # NOTE: This is the list of Mono versions to add test + # constraints for. + # + set monoVersions [list] + + # + # NOTE: Check each Mono version "known" to the test suite. + # + foreach monoVersion [getKnownMonoVersions] { + # + # NOTE: Check for any Mono major version X or higher. + # + if {$majorVersion >= [lindex $monoVersion 0]} then { + # + # NOTE: Check for any Mono major/minor version higher + # than X.Y. + # + if {$majorVersion > [lindex $monoVersion 0] || \ + $minorVersion > [lindex $monoVersion 1]} then { + # + # NOTE: Add this "known" version of Mono. + # + lappend monoVersions $monoVersion + } + } + } + + # + # NOTE: Add the necessary constraints for each version of Mono + # we should NOT skip bugs for. + # + foreach monoVersion $monoVersions { + set constraintVersion [join $monoVersion ""] + + addConstraint [appendArgs mono $constraintVersion OrHigher] + addConstraint [appendArgs monoToDo $constraintVersion] + addConstraint [appendArgs monoBug $constraintVersion] + addConstraint [appendArgs monoCrash $constraintVersion] + } + } + } else { + # + # NOTE: If the runtime version was found, add a test constraint + # for it now. + # if {[string length $version] > 0} then { # # NOTE: We are running on the .NET Framework. Keep track of the # specific version for usage in test constraints. # addConstraint [appendArgs dotNet $version] + addConstraint [appendArgs dotNet $version OrHigher] } # # NOTE: We do not want to skip any Mono bugs on .NET. Add the # necessary constraints for each version of Mono we know # about. # - foreach monoVersion [list 20 22 24 26 28 210 211 212 30] { - addConstraint [appendArgs monoToDo $monoVersion] - addConstraint [appendArgs monoBug $monoVersion] - addConstraint [appendArgs monoCrash $monoVersion] + foreach monoVersion [getKnownMonoVersions] { + set constraintVersion [join $monoVersion ""] + + addConstraint [appendArgs monoToDo $constraintVersion] + addConstraint [appendArgs monoBug $constraintVersion] + addConstraint [appendArgs monoCrash $constraintVersion] } } tputs $channel [appendArgs $::eagle_platform(runtimeVersion) \ " " ( $dotVersion ) \n] @@ -2129,11 +2173,13 @@ # # NOTE: Save the directory for later usage by # the test itself. # - set ::test_wix $directory + if {![info exists ::no(setWix)]} then { + set ::test_wix $directory + } # # NOTE: Show where we found it. # tputs $channel [appendArgs "yes (" $version ", via " $where ", \"" \ @@ -2146,10 +2192,37 @@ } } tputs $channel no\n } + + proc checkForTargetFramework { channel } { + tputs $channel "---- checking for target framework... " + + if {[info exists ::eagle_platform(targetFramework)] && \ + [string length $::eagle_platform(targetFramework)] > 0} then { + # + # NOTE: Now create a string for use in the constraint name (remove + # the invalid characters). For example: + # + # ".NETFramework,Version=v2.0" --> "NETFramework.Version.v2.0" + # + set targetFramework [string trimleft [string map [list , . = .] \ + $::eagle_platform(targetFramework)] .] + + # + # NOTE: Keep track of the specific target framework for usage in test + # constraints. + # + addConstraint [appendArgs targetFramework. $targetFramework] + + tputs $channel [appendArgs $::eagle_platform(targetFramework) \ + " " ( $targetFramework ) \n] + } else { + tputs $channel no\n + } + } proc checkForNetFx45 { channel } { tputs $channel "---- checking for .NET Framework 4.5... " # @@ -2249,11 +2322,13 @@ # # NOTE: Save the directory for later usage by # the test itself. # - set ::test_visual_studio [file dirname $fileName] + if {![info exists ::no(setVisualStudio)]} then { + set ::test_visual_studio [file dirname $fileName] + } } } } if {[llength $visualStudioVersions] > 0} then { @@ -2372,20 +2447,22 @@ # # NOTE: We need several of our test constraint related commands in the # global namespace. # - exportAndImportPackageCommands [namespace current] [list checkForPlatform \ - checkForEagle checkForGaruda checkForShell checkForDebug checkForTk \ - checkForVersion checkForCommand checkForFile checkForNativeCode \ - checkForTip127 checkForTip194 checkForTip241 checkForTip285 \ - checkForTip405 checkForPerformance checkForTiming checkForInteractive \ - checkForSymbols checkForLogFile checkForNetwork checkForCompileOption \ - checkForInteractiveCommand checkForWindowsCommandProcessor \ - checkForUserInteraction checkForTclOptions checkForTestConfiguration \ - checkForTestSuffix checkForVariable checkForScriptLibrary \ - checkForStackIntensive checkForFossil] false false + exportAndImportPackageCommands [namespace current] [list \ + getKnownMonoVersions checkForPlatform checkForScriptLibrary \ + checkForVariable checkForTclOptions checkForWindowsCommandProcessor \ + checkForFossil checkForEagle checkForSymbols checkForLogFile \ + checkForGaruda checkForShell checkForDebug checkForTk checkForVersion \ + checkForCommand checkForTestMachine checkForTestPlatform \ + checkForTestConfiguration checkForTestSuffix checkForFile \ + checkForPathFile checkForNativeCode checkForTip127 checkForTip194 \ + checkForTip241 checkForTip285 checkForTip405 checkForTiming \ + checkForPerformance checkForStackIntensive checkForInteractive \ + checkForInteractiveCommand checkForUserInteraction checkForNetwork \ + checkForCompileOption] false false ########################################################################### ############################## END Tcl ONLY ############################### ########################################################################### } Index: Externals/Eagle/lib/Test1.0/prologue.eagle ================================================================== --- Externals/Eagle/lib/Test1.0/prologue.eagle +++ Externals/Eagle/lib/Test1.0/prologue.eagle @@ -238,10 +238,12 @@ ############################################################################# # # NOTE: If command line arguments were supplied, process them now. # + set test_flags(-machine) ""; # machine architecture, default to empty. + set test_flags(-platform) ""; # build platform, default to empty. set test_flags(-configuration) ""; # build configuration, default to empty. set test_flags(-suffix) ""; # build suffix, default to empty. set test_flags(-file) [list *.eagle]; # default to running all test files. set test_flags(-notFile) [list l.*.eagle]; # COMPAT: Tcl. set test_flags(-match) [list *]; # default to running all tests. @@ -324,10 +326,25 @@ # NOTE: Set the pre-test script to the one provided by the command line. # set test_script(post) $test_flags(-postTest) } } + + # + # NOTE: Set the default test machine (e.g. amd64, intel, etc), if necessary. + # + if {![info exists test_machine]} then { + set test_machine [expr {[info exists tcl_platform(machine)] ? \ + $tcl_platform(machine) : ""}] + } + + # + # NOTE: Set the default test platform (e.g. x86, x64, etc), if necessary. + # + if {![info exists test_platform]} then { + set test_platform [machineToPlatform $test_machine true] + } # # NOTE: Set the default test configuration (i.e. Debug or Release), if # necessary. # @@ -442,10 +459,18 @@ tputs $test_channel [appendArgs "---- processId: " \ [pid] \n] tputs $test_channel [appendArgs "---- test channel: " \ $test_channel \n] + + tputs $test_channel [appendArgs "---- test machine: " \ + [expr {[info exists test_machine] ? \ + $test_machine : ""}] \n] + + tputs $test_channel [appendArgs "---- test platform: " \ + [expr {[info exists test_platform] ? \ + $test_platform : ""}] \n] tputs $test_channel [appendArgs "---- test configuration: " \ [expr {[info exists test_configuration] ? \ $test_configuration : ""}] \n] @@ -683,20 +708,28 @@ if {![info exists no(runtime)]} then { checkForRuntime $test_channel } # - # NOTE: Check the runtime version (i.e. what version of the runtime - # are we currently running on?). + # NOTE: Check the variant and/or version of the CLR that we are + # currently running on. # if {![info exists no(runtimeVersion)]} then { checkForRuntimeVersion $test_channel } # - # NOTE: Check the image runtime version (i.e. what version of the - # runtime was this assembly compiled against?). + # NOTE: Check the framework version (i.e. regardless of runtime) that + # we are currently running on. + # + if {![info exists no(frameworkVersion)]} then { + checkForFrameworkVersion $test_channel + } + + # + # NOTE: Check the image runtime version (i.e. the runtime version that + # this assembly compiled against). # if {![info exists no(imageRuntimeVersion)]} then { checkForImageRuntimeVersion $test_channel } @@ -1369,10 +1402,19 @@ # NOTE: For test "object-4.1". # checkForObjectMember $test_channel Eagle._Tests.Default \ *TestExpr* + # + # NOTE: For test "array-4.1". + # + checkForObjectMember $test_channel Eagle._Tests.Default \ + *TestTwoByteArrays* + + checkForObjectMember $test_channel Eagle._Tests.Default \ + *TestReturnByteArray* + # # NOTE: For test "object-7.1". # checkForObjectMember $test_channel Eagle._Tests.Default \ *TestByRefValueTypeMethod* @@ -1523,10 +1565,17 @@ # NOTE: For test "object-12.1.*". # checkForNetFx45 $test_channel } + # + # NOTE: Has target framework testing support been disabled? + # + if {![info exists no(targetFramework)]} then { + checkForTargetFramework $test_channel + } + # # NOTE: Has Visual Studio testing support been disabled? # if {![info exists no(visualStudio)]} then { checkForVisualStudio $test_channel @@ -1663,10 +1712,24 @@ ####################### BEGIN Tcl & Eagle Constraints ####################### ############################################################################# tputs $test_channel [appendArgs \ "---- start of common (Tcl & Eagle) test constraints...\n"] + + # + # NOTE: Has checking for the test machine been disabled? + # + if {![info exists no(testMachine)]} then { + checkForTestMachine $test_channel + } + + # + # NOTE: Has checking for the test platform been disabled? + # + if {![info exists no(testPlatform)]} then { + checkForTestPlatform $test_channel + } # # NOTE: Has checking for the test configuration been disabled? # if {![info exists no(testConfiguration)]} then { @@ -1856,18 +1919,17 @@ # # NOTE: Did we manage to find the native SQLite library? If not, do we # at least know the machine type? # - if {![haveConstraint file_sqlite3.dll] && \ - [info exists tcl_platform(machine)]} then { + if {![haveConstraint file_sqlite3.dll]} then { # # NOTE: Ok, now try to check for the machine specific native SQLite # library. # checkForFile $test_channel [file join $bin_path [machineToPlatform \ - $tcl_platform(machine) true] sqlite3.dll] + $test_machine true] sqlite3.dll] # # NOTE: Did we manage to find the native SQLite library yet? # if {![haveConstraint file_sqlite3.dll]} then { @@ -1874,11 +1936,11 @@ # # NOTE: Ok, now try to check for the platform specific native SQLite # library. # checkForFile $test_channel [file join $bin_path [machineToPlatform \ - $tcl_platform(machine) false] sqlite3.dll] + $test_machine false] sqlite3.dll] } } } if {![info exists no(System.Data.SQLite.dll)]} then { @@ -2222,10 +2284,13 @@ tputs $test_channel [appendArgs "---- strongName: " \ [getPlatformInfo strongName ] \n] tputs $test_channel [appendArgs "---- certificate: " \ [getPlatformInfo certificate ] \n] + + tputs $test_channel [appendArgs "---- targetFramework: " \ + [getPlatformInfo targetFramework ] \n] } # # NOTE: Show the current test file name, if any. # Index: Tests/common.eagle ================================================================== --- Tests/common.eagle +++ Tests/common.eagle @@ -87,10 +87,59 @@ return 2008; # TODO: Good "fallback" default? } } } } + + proc getBuildYears {} { + # + # NOTE: See if the list of test years has been overridden by the user + # (e.g. on the command line). + # + if {[info exists ::test_years] && [llength $::test_years] > 0} then { + # + # NOTE: Use the specified list of test years. + # + return $::test_years + } else { + # + # NOTE: Use the default list of test years. + # + return [list 2005 2008 2010 2012] + } + } + + proc getBuildPlatform { native } { + if {[info exists ::test_platform] && \ + [string length $::test_platform] > 0} then { + # + # NOTE: Use the specified test platform. If this variable is not set, + # the default value will be based on the machine architecture. + # + return [expr {$native ? $::test_platform : ""}] + } elseif {[info exists ::test_machine] && \ + [string length $::test_machine] > 0} then { + # + # NOTE: For native builds, return the platform name corresponding to + # the test machine architecture; otherwise, return an empty + # string. + # + return [expr {$native ? [machineToPlatform $::test_machine] : ""}] + } elseif {[info exists ::tcl_platform(machine)]} then { + # + # NOTE: For native builds, return the platform name corresponding to + # the machine architecture; otherwise, return an empty string. + # + return [expr {$native ? \ + [machineToPlatform $::tcl_platform(machine)] : ""}] + } else { + # + # NOTE: No machine architecture is available, return an empty string. + # + return "" + } + } proc getBuildConfiguration {} { # # NOTE: See if the "configuration" setting has been overridden by the user # (e.g. on the command line). This helps control exactly which set @@ -123,10 +172,72 @@ # from the -preTest option to the test suite. # return $::eagle_platform(configuration) } } + + proc getBuildConfigurations {} { + # + # NOTE: See if the list of test configurations has been overridden by + # the user (e.g. on the command line). + # + if {[info exists ::test_configurations] && \ + [llength $::test_configurations] > 0} then { + # + # NOTE: Use the specified list of test configurations. + # + return $::test_configurations + } else { + # + # NOTE: Use the default list of test configurations. + # + return [list Debug Release] + } + } + + proc getBuildBaseDirectory {} { + # + # NOTE: Figure out the base directory where all the builds should be + # located. This will be the directory that contains the actual + # build output directory (e.g. parent of "bin"). + # + if {[info exists ::build_base_directory] && \ + [string length $::build_base_directory] > 0} then { + # + # NOTE: The location of the build base directory has been overridden; + # therefore, use it verbatim. + # + set path $::build_base_directory + } elseif {[info exists ::common_directory] && \ + [string length $::common_directory] > 0} then { + # + # NOTE: Next, fallback to the parent directory of the one containing + # this file (i.e. "common.eagle"), if available. + # + set path [file dirname $::common_directory] + } else { + # + # NOTE: Finally, fallback to the parent directory of the EagleTest + # path. The EagleTest package guarantees that this variable + # will be set to the directory containing the first file to + # execute the [runTestPrologue] script library procedure. + # + set path [file dirname $::path] + } + } + + proc joinBuildDirectory { path native year platform configuration } { + # + # NOTE: Figure out and then return the fully qualified path to the build + # directory based on all the arguments provided by our caller. + # + if {$native} then { + return [file join $path bin $year $platform $configuration] + } else { + return [file join $path bin $year $configuration bin] + } + } proc getBuildDirectory {} { # # NOTE: See if the "native" runtime option has been set. If so, use the # directory for the mixed-mode assembly (a.k.a. the native interop @@ -150,38 +261,10 @@ # NOTE: The location of the build directory has been overridden; # therefore, use it verbatim. # return $::build_directory } else { - # - # NOTE: Figure out the build base directory. This will be the directory - # that contains the actual build output directory (e.g. "bin"). - # - if {[info exists ::build_base_directory] && \ - [string length $::build_base_directory] > 0} then { - # - # NOTE: The location of the build base directory has been overridden; - # therefore, use it verbatim. - # - set path $::build_base_directory - } elseif {[info exists ::common_directory] && \ - [string length $::common_directory] > 0} then { - # - # NOTE: Next, fallback to the parent directory of the one containing - # this file (i.e. "common.eagle"), if available. - # - set path [file dirname $::common_directory] - } else { - # - # NOTE: Finally, fallback to the parent directory of the EagleTest - # path. The EagleTest package guarantees that this variable - # will be set to the directory containing the first file to - # execute the [runTestPrologue] script library procedure. - # - set path [file dirname $::path] - } - # # NOTE: If the "native" runtime option is set, the mixed-mode assembly # is being tested. In that case, the path to the build directory # will contain the platform name and all the binaries under test # should be present in that directory. If the "native" runtime @@ -218,17 +301,14 @@ # the latest version of MSBuild available and the "test_year" may # need to be adjusted accordingly to actually run the test suite. # Refer to the comments in [getBuildYear] for more information on # how to set this variable. # - if {[hasRuntimeOption native]} then { - return [file join $path bin [getBuildYear] [machineToPlatform \ - $::tcl_platform(machine)] [getBuildConfiguration]] - } else { - return [file join $path bin [getBuildYear] [getBuildConfiguration] \ - bin] - } + set native [hasRuntimeOption native] + + return [joinBuildDirectory [getBuildBaseDirectory] $native \ + [getBuildYear] [getBuildPlatform $native] [getBuildConfiguration]] } } proc getBuildFileName { fileName } { # @@ -624,10 +704,37 @@ # always return zero. # return [expr {[haveConstraint System.Data.SQLite] && \ [haveConstraint SQLite]}] } + + proc checkForSQLiteBuilds { channel } { + # + # NOTE: Check for every possible valid combination of values used when + # locating out the build output directory, showing each available + # build variation along the way. + # + foreach native [list false true] { + foreach year [getBuildYears] { + foreach configuration [getBuildConfigurations] { + tputs $channel [appendArgs \ + "---- checking for System.Data.SQLite build \"" [expr \ + {$native ? "native/" : ""}] $year / $configuration "\"... "] + + set fileName [file nativename [file join [joinBuildDirectory \ + [getBuildBaseDirectory] $native $year [getBuildPlatform \ + $native] $configuration] System.Data.SQLite.dll]] + + if {[file exists $fileName]} then { + tputs $channel yes\n + } else { + tputs $channel no\n + } + } + } + } + } proc checkForSQLite { channel } { tputs $channel "---- checking for core SQLite library... " if {[catch { @@ -1731,10 +1838,15 @@ } else { tputs $::test_channel unknown\n } } + # + # NOTE: Check the available builds of SQLite and System.Data.SQLite. + # + checkForSQLiteBuilds $::test_channel + # # NOTE: Now, we need to know if the SQLite core library is available # (i.e. because the managed-only System.Data.SQLite assembly can # load without it; however, it cannot do anything useful without # it). If we are using the mixed-mode assembly and we already