diff --git a/scripts/runTests.fsx b/scripts/runTests.fsx index 8816d673..9bc82b93 100755 --- a/scripts/runTests.fsx +++ b/scripts/runTests.fsx @@ -93,6 +93,33 @@ let UnwrapDefault(proc: ProcessResult) = proc.UnwrapDefault() |> ignore #endif +let fsxWorkingCommandInUnixAfterBeingInstalled = + { + Command = "/usr/bin/env" + Arguments = "fsx" + } + +let helpCommand = + let helpFlag = "--help" + + match Misc.GuessPlatform() with + | Misc.Platform.Windows -> + { + Command = GetFsxWindowsLauncher().FullName + Arguments = helpFlag + } + | _ -> + { + Command = fsxWorkingCommandInUnixAfterBeingInstalled.Command + Arguments = + sprintf + "%s %s" + fsxWorkingCommandInUnixAfterBeingInstalled.Arguments + helpFlag + } + +Process.Execute(helpCommand, Echo.All) |> UnwrapDefault + let basicTest = Path.Combine(TestDir.FullName, "test.fsx") |> FileInfo Process.Execute(CreateCommand(basicTest, String.Empty), Echo.All) @@ -334,7 +361,8 @@ Process.Execute(CreateCommand(legacyDefineTest, String.Empty), Echo.All) let contentOfScriptWithWarning = - """#!/usr/bin/env fsx + sprintf + """#!%s %s let GiveMeBool() : bool = false @@ -342,6 +370,8 @@ let GiveMeBool() : bool = GiveMeBool() printf "hello" """ + fsxWorkingCommandInUnixAfterBeingInstalled.Command + fsxWorkingCommandInUnixAfterBeingInstalled.Arguments let warningTest = Path.Combine(TestDir.FullName, "testWarning.fsx") |> FileInfo File.WriteAllText(warningTest.FullName, contentOfScriptWithWarning)