Skip to content

Commit 5890acf

Browse files
fixes OpenCV version check on osx + fixes build-debug for cover task + fixes appveyor env test
1 parent 76b0186 commit 5890acf

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

appveyor.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ install:
5656
- if not "%BUILD_TASK%" == "ENVS" SET PATH=%PATH%;%OPENCV_BIN_DIR%;
5757
- ps: Install-Product node $env:nodejs_version x64
5858
- node --version
59-
- npm install -g node-gyp
60-
- cd c:\projects\opencv4nodejs
61-
- npm install
6259

6360
build: off
6461

@@ -69,6 +66,8 @@ test_script:
6966
npm install &&
7067
npm test
7168
) else (
69+
cd c:\projects\opencv4nodejs &&
70+
npm install &&
7271
cd c:\projects\opencv4nodejs\test &&
7372
npm install &&
7473
npm run test-appveyor &&

install/install.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ process.env['OPENCV4NODEJS_DEFINES'] = defines.join('\n')
7777
process.env['OPENCV4NODEJS_INCLUDES'] = includes.join('\n')
7878
process.env['OPENCV4NODEJS_LIBRARIES'] = libs.join('\n')
7979

80-
const child = child_process.exec('node-gyp rebuild --jobs max', {}, function(err, stdout, stderr) {
80+
const flags = process.env.BINDINGS_DEBUG ? '--jobs max --debug' : '--jobs max'
81+
const child = child_process.exec('node-gyp rebuild ' + flags, {}, function(err, stdout, stderr) {
8182
const _err = err || stderr
8283
if (_err) log.error(_err)
8384
})

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"build": "node-gyp configure build --jobs max",
3535
"rebuild": "node-gyp rebuild --jobs max",
3636
"clean": "node-gyp clean",
37-
"build-debug": "node-gyp rebuild --debug --jobs max"
37+
"build-debug": "set BINDINGS_DEBUG=1 && node ./install/install.js"
3838
},
3939
"gypfile": true,
4040
"dependencies": {

test/tests/index.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@ describe('cv', () => {
7070
console.log('OPENCV_VERSION:', process.env.OPENCV_VERSION)
7171
console.log('TEST_MODULE_LIST:', process.env.TEST_MODULE_LIST)
7272
console.log('APPVEYOR_BUILD:', process.env.APPVEYOR_BUILD)
73+
console.log('process.platform:', process.platform)
7374
console.log()
7475
console.log('OpenCV version is:', opencvVersionString)
7576
console.log('compiled with the following modules:', cv.modules)
7677
console.log('expected modules to be built:', builtModules)
7778

7879
it('OpenCV version should match', () => {
79-
expect((process.env.OPENCV_VERSION || '').substr(0, 5)).to.equal(opencvVersionString)
80+
expect((process.env.OPENCV_VERSION || '').substr(0, 5)).to.equal(
81+
process.platform === 'osx' ? `${cv.version.major}` : opencvVersionString
82+
)
8083
})
8184

8285
it('all modules should be built', () => {

0 commit comments

Comments
 (0)