From fbc3df5e0818dd74adf53e2574be58c8a33ee00f Mon Sep 17 00:00:00 2001 From: Mikhail Yurasov Date: Thu, 21 Apr 2016 22:28:28 -0700 Subject: [PATCH 1/4] Add info messages output --- src/Message.nut | 7 ++++--- src/TestCase.nut | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Message.nut b/src/Message.nut index ed90a60..6e821b4 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 } diff --git a/src/TestCase.nut b/src/TestCase.nut index 3d1adcb..22a1df7 100644 --- a/src/TestCase.nut +++ b/src/TestCase.nut @@ -20,6 +20,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 From c1acc6d0e1d90f7d1cd44c69f9494c588aa1ef74 Mon Sep 17 00:00:00 2001 From: Mikhail Yurasov Date: Thu, 21 Apr 2016 22:32:26 -0700 Subject: [PATCH 2/4] Bump the version --- index.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From 15dcd4ac80fcf15c359012c92d1a34fcc53c126c Mon Sep 17 00:00:00 2001 From: Mikhail Yurasov Date: Thu, 21 Apr 2016 22:33:08 -0700 Subject: [PATCH 3/4] Add versions to components --- src/Message.nut | 2 ++ src/TestCase.nut | 2 ++ src/TestRunner.nut | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Message.nut b/src/Message.nut index 6e821b4..1e8499d 100644 --- a/src/Message.nut +++ b/src/Message.nut @@ -20,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 22a1df7..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; 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; From 6e751e50b3bd6feb09846dff60e9dc1e536567c4 Mon Sep 17 00:00:00 2001 From: Mikhail Yurasov Date: Thu, 21 Apr 2016 22:33:55 -0700 Subject: [PATCH 4/4] Update dist --- dist/impUnit.nut | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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;