Skip to content

Commit fcfc612

Browse files
romandevmhdawson
authored andcommitted
build: new build targets for debug purposes
In this project, we can use the following command to test examples. $ npm test It might be very inefficient, especially, if the number of files increases. So, this patch introduces new build targets for debugging purpose as follows: $ npm run-script dev # Build with --debug option $ npm run-script dev:incremental # Incremental dev build This idea comes from @DaAitch. PR-URL: #186 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent c629553 commit fcfc612

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ npm install
141141
npm test --disable-deprecated
142142
```
143143

144+
### **Debug**
145+
146+
To run the **node-addon-api** tests with `--debug` option:
147+
148+
```
149+
npm run-script dev
150+
```
151+
152+
If you want faster build, you might use the following option:
153+
154+
```
155+
npm run-script dev:incremental
156+
```
157+
144158
Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/master/test)**
145159

146160
<a name="resources"></a>

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
"scripts": {
5757
"pretest": "node-gyp rebuild -C test",
5858
"test": "node test",
59+
"predev": "node-gyp rebuild -C test --debug",
60+
"dev": "node test",
61+
"predev:incremental": "node-gyp configure build -C test --debug",
62+
"dev:incremental": "node test",
5963
"doc": "doxygen doc/Doxyfile"
6064
},
6165
"version": "1.6.2"

0 commit comments

Comments
 (0)