diff --git a/dist/impUnit.nut b/dist/impUnit.nut index afaa525..2f24559 100644 --- a/dist/impUnit.nut +++ b/dist/impUnit.nut @@ -2,7 +2,7 @@ * impUnit Test Framework * * @author Mikhail Yurasov - * @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; diff --git a/index.nut b/index.nut index a547ffb..b34dbaa 100644 --- a/index.nut +++ b/index.nut @@ -2,7 +2,7 @@ * impUnit Test Framework * * @author Mikhail Yurasov - * @version 0.4.3 + * @version 0.5.0 * @package ImpUnit */ diff --git a/src/Message.nut b/src/Message.nut index ed90a60..1e8499d 100644 --- a/src/Message.nut +++ b/src/Message.nut @@ -5,12 +5,13 @@ // 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 } @@ -19,6 +20,8 @@ local ImpUnitMessageTypes = { */ local ImpUnitMessage = class { + static version = [0, 5, 0]; + type = ""; message = ""; session = ""; diff --git a/src/TestCase.nut b/src/TestCase.nut index 3d1adcb..5bc52ab 100644 --- a/src/TestCase.nut +++ b/src/TestCase.nut @@ -4,6 +4,8 @@ */ local ImpTestCase = class { + static version = [0, 5, 0]; + runner = null; // runner instance session = null; // session name assertions = 0; @@ -20,6 +22,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 diff --git a/src/TestRunner.nut b/src/TestRunner.nut index 3e15b43..89602e6 100644 --- a/src/TestRunner.nut +++ b/src/TestRunner.nut @@ -8,6 +8,8 @@ */ local ImpUnitRunner = class { + static version = [0, 5, 0]; + // options timeout = 2; readableOutput = true;