diff --git a/tests/fsharpqa/Source/MultiTargeting/MultiTargetMatrix.fsx b/tests/fsharpqa/Source/MultiTargeting/MultiTargetMatrix.fsx index fb8f5a7269e..7f90ee19659 100644 --- a/tests/fsharpqa/Source/MultiTargeting/MultiTargetMatrix.fsx +++ b/tests/fsharpqa/Source/MultiTargeting/MultiTargetMatrix.fsx @@ -25,23 +25,29 @@ module Helpers = run compilerPath ["-o:consumer.exe"; "--noframework"; sprintf "\"-r:%s\"" runtime; "-r:author.dll"; source] let private consumerRunFsi fsiPath source = + let localFSharpCore = Path.Combine(Environment.CurrentDirectory, "FSharp.Core.dll") + if File.Exists(localFSharpCore) then + File.Delete(localFSharpCore) run fsiPath ["--exec"; source] + /// gets the version of the assembly at the specified path + let getVer dllPath = + let asm = Assembly.ReflectionOnlyLoadFrom(dllPath) + asm.GetName().Version.ToString() + // runs the consumer EXE, handling binding redirects automatically - let private consumerRunExe redirectVer = + let private consumerRunExe consumerRuntime = if File.Exists("consumer.exe.config") then File.Delete("consumer.exe.config") - + + let redirectVer = getVer consumerRuntime let content = File.ReadAllText("consumer.exe.config.txt").Replace("{ver}", redirectVer) - File.WriteAllText("consumer.exe.config", content) + File.WriteAllText("consumer.exe.config", content) + + File.Copy(consumerRuntime, Path.Combine(Environment.CurrentDirectory, "FSharp.Core.dll"), true) run "consumer.exe" [] - /// gets the version of the assembly at the specified path - let getVer dllPath = - let asm = Assembly.ReflectionOnlyLoadFrom(dllPath) - asm.GetName().Version.ToString() - /// runs through the end-to-end scenario of /// - Author uses [authorComiler] to build DLL targeting [authorRuntime] with source [authorSource] /// - Consumer uses [consumerCompiler] to build EXE ref'ing above DLL, building EXE targeting [consumerRuntime] with source [consumerSource] @@ -49,7 +55,7 @@ module Helpers = let testExe authorCompiler authorRuntime consumerCompiler consumerRuntime authorSource consumerSource = authorCompile authorCompiler authorRuntime authorSource consumerCompile consumerCompiler consumerRuntime consumerSource - consumerRunExe (getVer consumerRuntime) + consumerRunExe consumerRuntime /// runs through the end-to-end scenario of /// - Author uses [authorComiler] to build DLL targeting [authorRuntime] with source [authorSource] diff --git a/tests/fsharpqa/Source/MultiTargeting/env.lst b/tests/fsharpqa/Source/MultiTargeting/env.lst index dab52c34075..0bc5f2de1aa 100644 --- a/tests/fsharpqa/Source/MultiTargeting/env.lst +++ b/tests/fsharpqa/Source/MultiTargeting/env.lst @@ -5,6 +5,6 @@ NOMONO SOURCE=E_BadPathToFSharpCore.fsx SCFLAGS="--noframework -r %W # FSharp.Core is checked in for this test to verify a particular error message related to it. It shouldn't be accidentally picked up by other tests since it isn't in the working directory for them NOMONO SOURCE=E_UseBinaryIncompatibleLibrary.fs SCFLAGS="--noframework -r ..\\Common\\FSharp.Core.dll" # E_UseBinaryIncompatibleLibrary.fs -ReqOpen SOURCE=dummy.fs POSTCMD="\$FSI_PIPE --nologo --quiet --exec .\\MultiTargetMatrix.fsx QuotedCommaTypeName_author.fs QuotedCommaTypeName_consumer.fsx 0,8" # QuotedCommaTypeName +ReqOpen SOURCE=dummy.fs POSTCMD="\$FSI_PIPE --nologo --quiet --exec .\\MultiTargetMatrix.fsx QuotedCommaTypeName_author.fs QuotedCommaTypeName_consumer.fsx" # QuotedCommaTypeName ReqOpen SOURCE=dummy.fs POSTCMD="\$FSI_PIPE --nologo --quiet --exec .\\MultiTargetMatrix.fsx InlineCoreResource_author.fs InlineCoreResource_consumer.fsx" # InlineCoreResource ReqOpen SOURCE=dummy.fs POSTCMD="\$FSI_PIPE --nologo --quiet --exec .\\MultiTargetMatrix.fsx OptimizedForLoops_author.fs OptimizedForLoops_consumer.fsx" # OptimizedForLoops \ No newline at end of file