How to create a merged string from an include file

I use FAKE as a building tool, but I must admit that I'm pretty new to F#functional programming

To run my test, I use the following code that works:

trace "BuildTests..."
!! "Tests/**.Tests/*.csproj"
|> Seq.iter (fun p -> 
  [p]
  |> MSBuildDebug (testDir @@ Path.GetFileNameWithoutExtension(p)) "Build"
  |> Log "TestBuild-Output: "
)

trace "RunTests..."
!! (testDir + "**/*.Tests.dll") 
  |> MSTest (fun p -> 
    { p with 
        TestSettingsPath = testSettingsPath
        ResultsDir = artifactsDir
        ErrorLevel = ErrorLevel.DontFailBuild })

But now I want to use OpenCoverinstead of MSTest to run my tests. Basically, an OpenCover call is

OpenCover (fun p -> 
    { p with 
        Output=(artifactsDir + "output.xml")
        OptionalArguments = "-excludebyfile:*Designer.* -returntargetcode" })
        "/testcontainer:Path.To.First.Test.dll /testcontainer:Path.To.Second.Test.dll"

So my question is how to convert the result of FileInclude, for example !! (testDir + "**/*.Tests.dll"), to a combo string

/testcontainer:file1.dll /testcontainer:file2.dll /testcontainer:file3.dll

so i can use it with opencover task

+4
source share
1 answer

Like yours

!! "Tests/**.Tests/*.csproj"
|> Seq.iter (fun p ->

convert Seqeuence to an array and execute it.

!! (testDir + "**/*.Tests.dll") 
|> Seq.toArray 
|> String.concat " "
+5

Source: https://habr.com/ru/post/1618436/


All Articles