Skip to content

Commit

Permalink
fix travis module list tests for opencv without contrib + osx opencv@3
Browse files Browse the repository at this point in the history
  • Loading branch information
justadudewhohacks committed Jun 17, 2019
1 parent 07d0d0d commit 24a1c8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ matrix:
env:
- OPENCV_VERSION=$OPENCV3_LATEST
BUILD_TASK=test
TEST_MODULE_LIST=core,calib3d,dnn,features2d,imgproc,io,ml,objdetect,photo,video
# OpenCV 4.X without contrib
- os: linux
node_js: $LATEST_STABLE_NODEJS_VERSION
env:
- OPENCV_VERSION=$OPENCV4_LATEST
BUILD_TASK=test
TEST_MODULE_LIST=core,calib3d,dnn,features2d,imgproc,io,ml,objdetect,photo,video
# OpenCV 3.X contrib world
- os: linux
node_js: $LATEST_STABLE_NODEJS_VERSION
Expand Down Expand Up @@ -164,6 +166,8 @@ matrix:
node_js: $LATEST_STABLE_NODEJS_VERSION
env:
- OPENCV_VERSION=3
# apparently opencv@3 brew package does not include opencv text module
TEST_MODULE_LIST=core,calib3d,dnn,features2d,imgproc,io,ml,objdetect,photo,video,face,tracking,xfeatures2d,ximgproc

# osx opencv@4
- os: osx
Expand Down
22 changes: 12 additions & 10 deletions test/tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ describe('cv', () => {
peoplesTestImg = utils.readPeoplesTestImage();
});

let builtModules = modules.concat(xmodules)
if (process.env.APPVEYOR_BUILD) {
// OpenCV installed via choco does not include contrib modules
builtModules = modules
}
if (process.env.TEST_MODULE_LIST) {
builtModules = process.env.TEST_MODULE_LIST.split(',')
}

console.log('compiled with the following modules:', cv.modules)
console.log('expected modules to be built:', builtModules)

it('all modules should be built', () => {
let builtModules = modules.concat(xmodules)
if (process.env.APPVEYOR_BUILD) {
// OpenCV installed via choco does not include contrib modules
builtModules = modules
}
if (process.env.TEST_MODULE_LIST) {
builtModules = process.env.TEST_MODULE_LIST.split(',')
}
console.log('compiled with the following modules:', cv.modules)
console.log('expected modules to be built:', builtModules)

builtModules.forEach(m => expect(cv.modules).to.have.property(m));
})
Expand Down

0 comments on commit 24a1c8b

Please sign in to comment.