From df4dd0452a050d7672699b27bebc3c884ccb6f0c Mon Sep 17 00:00:00 2001 From: Gray MacGregor Date: Thu, 4 Dec 2014 19:06:15 +0000 Subject: [PATCH 1/3] Updated generateMissingTests.js to run once called. --- generate/index.js | 2 +- generate/scripts/generateMissingTests.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/generate/index.js b/generate/index.js index 536dce70a..59faee9dc 100644 --- a/generate/index.js +++ b/generate/index.js @@ -1,3 +1,3 @@ require("./scripts/generateJson")(); require("./scripts/generateNativeCode")(); -require("./scripts/generateMissingTests")(); +require("./scripts/generateMissingTests"); diff --git a/generate/scripts/generateMissingTests.js b/generate/scripts/generateMissingTests.js index 6dfc06539..1b6c7aae2 100644 --- a/generate/scripts/generateMissingTests.js +++ b/generate/scripts/generateMissingTests.js @@ -8,7 +8,7 @@ const testFilesPath = "../test/tests"; const idefs = require("../output/idefs"); const missingFileIgnores = require("../input/ignored-missing-tests"); -module.exports = function() { +module.exports = (function generateMissingTests() { var output = {}; function findMissingTest(idef) { @@ -70,4 +70,5 @@ module.exports = function() { } ); -} +}()); + From 3efc4bcccf6f0e5dd4ba31b69c2a5dca8aa5ec03 Mon Sep 17 00:00:00 2001 From: Gray MacGregor Date: Thu, 4 Dec 2014 19:52:20 +0000 Subject: [PATCH 2/3] Updated CONTRIBUTING.md with correct missing tests command. --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8f6b7ce1..d7a981aad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,10 +8,10 @@ This is a guide on how to contribute test cases to help with coverage testing fo Currently there are a number of fields and functions in NodeGit that have no tests at all. A list of which files are missing and what fields and functions need tests can be generated by running ``` bash -npm run missing-tests +npm run generateMissingTests ``` -This will make the file `generate/missing-tests.json` which will contain info for tests or files that are currently missing. +This will make the file `generate/output/missing-tests.json` which will contain info for tests or files that are currently missing. From this file you can find fields and functions that don't have any tests yet and pick one to work on. @@ -42,7 +42,7 @@ If a specific field or function is further wrapped via a file inside of `/lib` t You can mark something to be ignored inside of the `/generate/missing-tests-ignore.json` file. -After you write your test make sure to run `npm run missing-tests` again to confirm that the field/function that a test was written for no longer shows up. +After you write your test make sure to run `npm run generateMissingTests` again to confirm that the field/function that a test was written for no longer shows up. ## Test results ## From 3006ad2cbbe62128e87599e1794a4acc58c7d2f5 Mon Sep 17 00:00:00 2001 From: Gray MacGregor Date: Thu, 4 Dec 2014 20:08:47 +0000 Subject: [PATCH 3/3] Updated "generate" scripts to run when called via npm. --- generate/index.js | 4 ++-- generate/scripts/generateJson.js | 4 ++-- generate/scripts/generateNativeCode.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generate/index.js b/generate/index.js index 59faee9dc..9eea74ecf 100644 --- a/generate/index.js +++ b/generate/index.js @@ -1,3 +1,3 @@ -require("./scripts/generateJson")(); -require("./scripts/generateNativeCode")(); +require("./scripts/generateJson"); +require("./scripts/generateNativeCode"); require("./scripts/generateMissingTests"); diff --git a/generate/scripts/generateJson.js b/generate/scripts/generateJson.js index 4bf029587..35430bff4 100644 --- a/generate/scripts/generateJson.js +++ b/generate/scripts/generateJson.js @@ -9,7 +9,7 @@ var libgit2 = require("../input/v" + version + ".json"); var descriptor = require("../input/descriptor.json"); var supplement = require("../input/libgit2-supplement.json"); -module.exports = function() { +module.exports = (function generateJson() { libgit2.types.forEach(function(type) { if (supplement.types[type[0]]){ _.merge(type[1], supplement.types[type[0]]); @@ -219,4 +219,4 @@ module.exports = function() { utils.writeFile("output/idefs.json", output); -} +}()); diff --git a/generate/scripts/generateNativeCode.js b/generate/scripts/generateNativeCode.js index 0960ec357..c277e0e9f 100644 --- a/generate/scripts/generateNativeCode.js +++ b/generate/scripts/generateNativeCode.js @@ -20,7 +20,7 @@ const exec = promisify(function(command, opts, callback) { const utils = require("./utils"); const idefs = require("../output/idefs"); -module.exports = function() { +module.exports = (function generateNativeCode() { // Customize the delimiters so as to not process `{{{` or `}}}`. combyne.settings.delimiters = { START_RAW: "{{=", @@ -143,4 +143,4 @@ module.exports = function() { }) }); -} +}());