diff options
Diffstat (limited to 'RPCTests/modules/testutils.js')
-rw-r--r-- | RPCTests/modules/testutils.js | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/RPCTests/modules/testutils.js b/RPCTests/modules/testutils.js index 7128c6972..54cd64525 100644 --- a/RPCTests/modules/testutils.js +++ b/RPCTests/modules/testutils.js @@ -26,31 +26,40 @@ generateCustomGenesis: function generateCustomGenesis(path, originalPath, accoun readTestsInFolder: function readTestsInFolder(path) { - var res = utils.listFiles(path); - res.forEach(function(file) { - var testn = file.indexOf("test"); - var slashn = file.indexOf("_"); - if (testn != -1 && slashn != -1) - { - testNumber = parseInt(file.substring(testn + 4, slashn)); - var noden = file.indexOf("node"); - var slashn = file.indexOf("_", slashn+1); - var tmpFile = file.indexOf("~"); - if (noden != -1 && slashn != -1 && tmpFile == -1) + var testNumber = 0; + var folders = utils.listFolders(path); + folders.forEach(function(folder) { + + var res = utils.listFiles(folder); + res.forEach(function(file) { + + var testn = file.indexOf("step"); + var slashn = file.indexOf("_"); + if (testn != -1 && slashn != -1) { - if (tests[testNumber]) - console.log("Error: dublicate test found " + file); - else + //testNumber = parseInt(file.substring(testn + 4, slashn)); + var noden = file.indexOf("node"); + var slashn = file.indexOf("_", slashn+1); + var tmpFile = file.indexOf("~"); + if (noden != -1 && slashn != -1 && tmpFile == -1) { - var testObject = {}; - testObject.file = file; - testObject.node = file.substring(noden + 4, slashn); - tests[testNumber] = testObject; - testCount++; + if (tests[testNumber]) + console.log("Error: dublicate test found " + file); + else + { + var testObject = {}; + testObject.file = file; + testObject.node = file.substring(noden + 4, slashn); + tests[testNumber] = testObject; + testCount++; + testNumber++; + } } } - } + }); }); + + //console.log(tests); }, getTestCount: function getTestCount() |