mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-17 11:05:46 +01:00
add some statistics to the regression script
This commit is contained in:
@@ -98,7 +98,9 @@ commands.addUserCommand(["regr[essions]"],
|
|||||||
|
|
||||||
function run ()
|
function run ()
|
||||||
{
|
{
|
||||||
|
let now = Date.now();
|
||||||
let totalTests = tests.length + functions.length;
|
let totalTests = tests.length + functions.length;
|
||||||
|
let successfulTests = 0;
|
||||||
let currentTest = 1;
|
let currentTest = 1;
|
||||||
|
|
||||||
// 1.) run commands and mappings tests
|
// 1.) run commands and mappings tests
|
||||||
@@ -118,6 +120,8 @@ commands.addUserCommand(["regr[essions]"],
|
|||||||
|
|
||||||
if (!test.verify())
|
if (!test.verify())
|
||||||
liberator.echoerr("Test failed: " + testDescription);
|
liberator.echoerr("Test failed: " + testDescription);
|
||||||
|
else
|
||||||
|
successfulTests++;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2.) Run function tests
|
// 2.) Run function tests
|
||||||
@@ -127,8 +131,11 @@ commands.addUserCommand(["regr[essions]"],
|
|||||||
|
|
||||||
if (!func())
|
if (!func())
|
||||||
liberator.echoerr("Test failed!");
|
liberator.echoerr("Test failed!");
|
||||||
|
else
|
||||||
|
successfulTests++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
liberator.echomsg(successfulTests + " of " + totalTests + " tests successfully completed in " + ((Date.now() - now) / 1000.0) + " msec");
|
||||||
liberator.execute(":messages");
|
liberator.execute(":messages");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user