-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch TestRunner for proper error code on exit.
- Loading branch information
Showing
1 changed file
with
33 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
#!/usr/bin/env io | ||
TestSuite clone setPath(System launchPath) run | ||
|
||
// patch TestRunner to upstream Io's version | ||
TestRunner run = method(testMap, | ||
self cases := testMap # Storing a reference to the test map. | ||
self runtime := Date secondsToRun( | ||
testMap foreach(testCaseName, testSlotNames, | ||
# Depending on the Lobby is kind of wacky, but that's | ||
# all we can do, since Map only supports string keys. | ||
testCase := Lobby getSlot(testCaseName) | ||
testSlotNames foreach(name, | ||
testCase setUp | ||
exc := try(stopStatus(testCase doString(name))) | ||
if(exc, error(testCaseName .. " " .. name, exc), success) | ||
testCase tearDown | ||
) | ||
) | ||
) | ||
|
||
printExceptions | ||
printSummary | ||
self exceptions | ||
) | ||
|
||
if(System args size > 1, | ||
# Run specific tests. | ||
System args slice(1) foreach(name, | ||
Lobby doFile(System launchPath .. "\\" .. name) | ||
) | ||
System exit(FileCollector run size) | ||
, | ||
# Run all tests in the current directory. | ||
System exit(DirectoryCollector run size) | ||
) |