forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.base.line.with.actuals.fsx
More file actions
27 lines (22 loc) · 1.16 KB
/
update.base.line.with.actuals.fsx
File metadata and controls
27 lines (22 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
open System.IO
// this script is usefull for tests using a .bsl file (baseline) containing expected compiler output
// which is matched against .vserr or .err file aside once the test has run
// the script replaces all the .bsl/.bslpp with either .err or .vserr
let directories =
[
"typecheck/sigs"
"typeProviders/negTests"
]
|> List.map (fun d -> Path.Combine(__SOURCE_DIRECTORY__, d) |> DirectoryInfo)
let extensionPatterns = ["*.err"; "*.vserr"]
for d in directories do
for p in extensionPatterns do
for errFile in d.GetFiles p do
let baseLineFile = FileInfo(Path.ChangeExtension(errFile.FullName, "bsl"))
let baseLineFilePreProcess = FileInfo(Path.ChangeExtension(errFile.FullName, "bslpp"))
if File.ReadAllText(errFile.FullName) <> File.ReadAllText(baseLineFile.FullName) then
let expectedFile =
if baseLineFilePreProcess.Exists then baseLineFilePreProcess
else baseLineFile
printfn "%s not matching, replacing with %s" expectedFile.FullName errFile.FullName
errFile.CopyTo(expectedFile.FullName, true) |> ignore