Failing examples tests

This commit is contained in:
Peter Braden 2014-10-15 20:01:44 +02:00
parent b9fbf5f526
commit 18394814ab
4 changed files with 24 additions and 3 deletions

View File

@ -1,9 +1,9 @@
var cv = require('../lib/opencv');
cv.readImage("./files/mona.png", function(err, orig) {
cv.readImage("./examples/files/mona.png", function(err, orig) {
if (err) throw err;
cv.readImage("./files/over_text.png", function(err, over_text) {
cv.readImage("./examples/over_text.png", function(err, over_text) {
if (err) throw err;
var result = new cv.Matrix(orig.width(), orig.height());

View File

@ -8,7 +8,8 @@
},
"version": "1.0.0",
"devDependencies": {
"tape": "^3.0.0"
"tape": "^3.0.0",
"glob": "^4.0.6"
},
"license": "MIT",
"scripts": {

16
test/examples.js Normal file
View File

@ -0,0 +1,16 @@
var test = require('tape')
, glob = require('glob')
, exec = require('child_process').exec
module.exports = function(){
glob.sync('./examples/*.js').forEach(function(example){
test("Example: " + example, function(assert){
exec('node ' + example, function(error, stdout, stderr){
assert.error(error)
assert.end()
})
})
})
}

View File

@ -275,3 +275,7 @@ test("fonts", function(t) {
});
})
// Test the examples folder.
require('./examples')()