travis and prebuildify

xattr-fix
Mathias Buus 5 years ago
parent 3fd1f9ef53
commit 46d09be1d9

@ -0,0 +1,37 @@
language: node_js
sudo: required
osx_image: xcode8.3
node_js:
- node
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- gcc-4.8-multilib
- g++-4.8-multilib
- gcc-multilib
- g++-multilib
os:
- osx
- linux
before_install:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cinst -y python2; fi
install:
- npm install
- npm run configure
before_deploy:
- ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$TRAVIS_OS_NAME.tar"
- npm run prebuild
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then PREBUILD_ARCH=ia32 npm run prebuild; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then PREBUILD_ARCH=ia32 npm run prebuild; fi
- cd prebuilds && tar cvf "../$ARCHIVE_NAME" . && cd ..

@ -9,8 +9,12 @@
"scripts": {
"install": "node-gyp-build",
"test": "tape test/*.js",
"prebuild": "prebuildify -a --strip",
"prebuild-ia32": "prebuildify -a --strip --arch=ia32"
"prebuild": "prebuildify --napi --strip",
"prebuild-ia32": "prebuildify --napi --strip --arch=ia32",
"configure": "NODE=$(which node) && sudo -E $NODE ./bin.js configure || true"
},
"bin": {
"fuse-native": "./bin.js"
},
"gypfile": true,
"dependencies": {
@ -22,6 +26,7 @@
},
"devDependencies": {
"concat-stream": "^2.0.0",
"prebuildify": "^3.0.4",
"standard": "^13.1.0",
"tape": "^4.11.0"
},

@ -0,0 +1,6 @@
exports.unmount = function (fuse, cb) { // This only seems to be nessesary an the ancient osx we use on travis so ... yolo
fuse.unmount(function (err) {
if (err) return cb(err)
setTimeout(cb, 1000)
})
}

@ -1,6 +1,7 @@
const tape = require('tape')
const fs = require('fs')
const path = require('path')
const { unmount } = require('./helpers')
const Fuse = require('../')
const mnt = require('./fixtures/mnt')
@ -53,7 +54,7 @@ tape('readlink', function (t) {
t.error(err, 'no error')
t.same(buf, Buffer.from('hello world'), 'can read link content')
fuse.unmount(function () {
unmount(fuse, function () {
t.end()
})
})

@ -1,14 +1,15 @@
var mnt = require('./fixtures/mnt')
var tape = require('tape')
const mnt = require('./fixtures/mnt')
const tape = require('tape')
var Fuse = require('../')
const Fuse = require('../')
const { unmount } = require('./helpers')
tape('mount', function (t) {
const fuse = new Fuse(mnt, {}, { force: true })
fuse.mount(function (err) {
t.error(err, 'no error')
t.ok(true, 'works')
fuse.unmount(function () {
unmount(fuse, function () {
t.end()
})
})
@ -21,11 +22,11 @@ tape('mount + unmount + mount', function (t) {
fuse1.mount(function (err) {
t.error(err, 'no error')
t.ok(true, 'works')
fuse1.unmount(function () {
unmount(fuse1, function () {
fuse2.mount(function (err) {
t.error(err, 'no error')
t.ok(true, 'works')
fuse2.unmount(function () {
unmount(fuse2, function () {
t.end()
})
})
@ -39,7 +40,7 @@ tape('mount + unmount + mount with same instance fails', function (t) {
fuse.mount(function (err) {
t.error(err, 'no error')
t.ok(true, 'works')
fuse.unmount(function () {
unmount(fuse, function () {
fuse.mount(function (err) {
t.ok(err, 'had error')
t.end()

@ -6,6 +6,7 @@ const concat = require('concat-stream')
const Fuse = require('../')
const mnt = require('./fixtures/mnt')
const stat = require('./fixtures/stat')
const { unmount } = require('./helpers')
tape('read', function (t) {
var ops = {
@ -23,7 +24,6 @@ tape('read', function (t) {
return process.nextTick(cb, 0, 42)
},
release: function (path, fd, cb) {
console.log('IN JS RELEASE')
t.same(fd, 42, 'fd was passed to release')
return process.nextTick(cb, 0)
},
@ -53,7 +53,7 @@ tape('read', function (t) {
fs.createReadStream(path.join(mnt, 'test'), { start: 6, end: 10 }).pipe(concat(function (buf) {
t.same(buf, Buffer.from('world'), 'partial read file + start offset')
fuse.unmount(function () {
unmount(fuse, function () {
t.end()
})
}))

@ -1,7 +1,8 @@
const { exec } = require('child_process')
var tape = require('tape')
const { unmount } = require('./helpers')
const tape = require('tape')
var Fuse = require('../')
const Fuse = require('../')
const mnt = require('./fixtures/mnt')
const stat = require('./fixtures/stat')
@ -29,7 +30,7 @@ tape('statfs', function (t) {
t.error(err, 'no error')
exec(`df ${mnt}`, (err) => {
t.error(err, 'no error')
fuse.unmount(function () {
unmount(fuse, function () {
t.end()
})
})

@ -5,6 +5,7 @@ const path = require('path')
const Fuse = require('../')
const mnt = require('./fixtures/mnt')
const stat = require('./fixtures/stat')
const { unmount } = require('./helpers')
tape('write', function (t) {
var created = false
@ -48,7 +49,7 @@ tape('write', function (t) {
t.error(err, 'no error')
t.same(data.slice(0, size), Buffer.from('hello world'), 'data was written')
fuse.unmount(function () {
unmount(fuse, function () {
t.end()
})
})

Loading…
Cancel
Save