Commit 6a7f5e59 by Dane Springmeyer

only test loading spatialite extension if it actually exists

parent 8ad31478
var sqlite3 = require('sqlite3');
var assert = require('assert');
var path = require('path');
if (process.setMaxListeners) process.setMaxListeners(0);
var spatialite_ext = '/usr/local/lib/libspatialite.dylib';
exports['test loadExtension'] = function(beforeExit) {
var db = new sqlite3.Database(':memory:');
var completed = false;
db.loadExtension('/usr/local/lib/libspatialite.dylib', function(err) {
if (err) throw err;
if (path.existsSync(spatialite_ext)) {
db.loadExtension(spatialite_ext, function(err) {
if (err) throw err;
completed = true;
});
} else {
completed = true;
});
}
beforeExit(function() {
assert.ok(completed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment