Last active
August 29, 2015 13:56
-
-
Save forki/9018549 to your computer and use it in GitHub Desktop.
UnitTests in NAV2013
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let connectionInfo = createRTCConnectionInfo navClientVersion nstServer nstServiceTierName nstPort company | |
let rec runSuite index = | |
tracefn " Starting Codeunit Index %i" index | |
CleanDir nstConfigDir | |
WriteConfigFile (nstConfigDir @@ "navconfig.txt") | |
["TestSuite", index.ToString() | |
"RootPath", FullName "."] | |
RunCodeunit connectionInfo 80500 | |
let messageFile = nstConfigDir @@ "message.txt" | |
let runTime = | |
try | |
WaitForMessageFile messageFile (System.TimeSpan.FromMinutes 5.) | |
with exn -> | |
if fileExists (messageFile + ".temp") then | |
CopyFile buildDir (messageFile + ".temp") | |
raise exn | |
CopyFile buildDir messageFile | |
match analyzeTestResults messageFile with | |
| None -> 0,0 | |
| Some results -> | |
UnitTestHelper.reportTestResults results | |
let failed,allTests = runSuite (index + 1) | |
failed + List.length(results.GetFailed()),allTests + results.GetTestCount() | |
let failed,allTests = runSuite 1 | |
if failed > 0 then | |
failwithf "%d of %d tests failed." failed allTests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// NavServiceTier (nst) connection Info
let nstConfigDir = "C:/temp/NAV"
let nstServer = "localhost"
let nstPort = 7046