-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
4 deletions.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* impUnit Test Framework | ||
* | ||
* @author Mikhail Yurasov <[email protected]> | ||
* @version 0.4.3 | ||
* @version 0.5.0 | ||
* @package ImpUnit | ||
*/ | ||
|
||
|
@@ -379,12 +379,13 @@ function __module_impUnit(Promise, JSONEncoder) { | |
|
||
// message types | ||
local ImpUnitMessageTypes = { | ||
sessionStart = "SESSION_START", // session start | ||
testStart = "TEST_START", // test start | ||
info = "INFO", // info message | ||
debug = "DEBUG", // debug message | ||
testOk = "TEST_OK", // test success | ||
testFail = "TEST_FAIL", // test failure | ||
testStart = "TEST_START", // test start | ||
sessionStart = "SESSION_START", // session start | ||
sessionResult = "SESSION_RESULT", // session result | ||
debug = "DEBUG", // debug message | ||
externalCommand = "EXTERNAL_COMMAND" // external command | ||
} | ||
|
||
|
@@ -393,6 +394,8 @@ local ImpUnitMessageTypes = { | |
*/ | ||
local ImpUnitMessage = class { | ||
|
||
static version = [0, 5, 0]; | ||
|
||
type = ""; | ||
message = ""; | ||
session = ""; | ||
|
@@ -435,6 +438,8 @@ local ImpUnitMessage = class { | |
*/ | ||
local ImpTestCase = class { | ||
|
||
static version = [0, 5, 0]; | ||
|
||
runner = null; // runner instance | ||
session = null; // session name | ||
assertions = 0; | ||
|
@@ -451,6 +456,18 @@ local ImpTestCase = class { | |
); | ||
} | ||
|
||
/** | ||
* Output an info message | ||
* @param {*=""} message | ||
*/ | ||
function info(message = "") { | ||
this.runner.log( | ||
ImpUnitMessage(ImpUnitMessageTypes.info, { | ||
"message": message | ||
}) | ||
); | ||
} | ||
|
||
/** | ||
* Assert that something is true | ||
* @param {bool} condition | ||
|
@@ -625,6 +642,8 @@ local ImpTestCase = class { | |
*/ | ||
local ImpUnitRunner = class { | ||
|
||
static version = [0, 5, 0]; | ||
|
||
// options | ||
timeout = 2; | ||
readableOutput = true; | ||
|