mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 02:30:12 +02:00
Add FreeBSD to CI via Cirrus #1953
This commit is contained in:
parent
11daa3b4d1
commit
1b401b1195
13
.cirrus.yml
Normal file
13
.cirrus.yml
Normal file
@ -0,0 +1,13 @@
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-0
|
||||
|
||||
task:
|
||||
prerequisites_script:
|
||||
- sed -i '' 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
|
||||
- pkg update -f
|
||||
- pkg upgrade -y
|
||||
- pkg install -y pkgconf vips libnghttp2 node npm
|
||||
install_script:
|
||||
- npm install --unsafe-perm
|
||||
test_script:
|
||||
- npm test
|
26
binding.gyp
26
binding.gyp
@ -183,16 +183,22 @@
|
||||
},
|
||||
'configurations': {
|
||||
'Release': {
|
||||
'cflags_cc': [
|
||||
'-Wno-cast-function-type'
|
||||
],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1
|
||||
}
|
||||
},
|
||||
'msvs_disabled_warnings': [
|
||||
4275
|
||||
'conditions': [
|
||||
['OS == "linux"', {
|
||||
'cflags_cc': [
|
||||
'-Wno-cast-function-type'
|
||||
]
|
||||
}],
|
||||
['OS == "win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1
|
||||
}
|
||||
},
|
||||
'msvs_disabled_warnings': [
|
||||
4275
|
||||
]
|
||||
}]
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -69,7 +69,7 @@
|
||||
"scripts": {
|
||||
"install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)",
|
||||
"clean": "rm -rf node_modules/ build/ vendor/ .nyc_output/ coverage/ test/fixtures/output.*",
|
||||
"test": "semistandard && cc && npm run test-unit && npm run test-licensing && prebuild-ci",
|
||||
"test": "semistandard && cpplint && npm run test-unit && npm run test-licensing && prebuild-ci",
|
||||
"test-unit": "nyc --reporter=lcov --branches=99 mocha --slow=5000 --timeout=60000 ./test/unit/*.js",
|
||||
"test-licensing": "license-checker --production --summary --onlyAllow=\"Apache-2.0;BSD;ISC;MIT\"",
|
||||
"test-coverage": "./test/coverage/report.sh",
|
||||
@ -118,7 +118,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "^3.1.0",
|
||||
"cc": "^1.0.2",
|
||||
"cc": "^2.0.1",
|
||||
"decompress-zip": "^0.3.2",
|
||||
"documentation": "^12.1.3",
|
||||
"exif-reader": "^1.0.3",
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const assert = require('assert');
|
||||
const promisify = require('util').promisify;
|
||||
const rimraf = require('rimraf');
|
||||
|
||||
const sharp = require('../../');
|
||||
@ -150,40 +151,40 @@ describe('TIFF', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('TIFF setting xres and yres on file', function (done) {
|
||||
const res = 1000.0; // inputTiff has a dpi of 300 (res*2.54)
|
||||
it('TIFF setting xres and yres on file', () =>
|
||||
sharp(fixtures.inputTiff)
|
||||
.tiff({
|
||||
xres: (res),
|
||||
yres: (res)
|
||||
xres: 1000,
|
||||
yres: 1000
|
||||
})
|
||||
.toFile(fixtures.outputTiff, (err, info) => {
|
||||
if (err) throw err;
|
||||
assert.strictEqual('tiff', info.format);
|
||||
sharp(fixtures.outputTiff).metadata(function (err, metadata) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(metadata.density, res * 2.54); // convert to dpi
|
||||
rimraf(fixtures.outputTiff, done);
|
||||
});
|
||||
});
|
||||
});
|
||||
.toFile(fixtures.outputTiff)
|
||||
.then(() => sharp(fixtures.outputTiff)
|
||||
.metadata()
|
||||
.then(({ density }) => {
|
||||
assert.strictEqual(true,
|
||||
density === 2540 || // libvips <= 8.8.2
|
||||
density === 25400); // libvips >= 8.8.3
|
||||
return promisify(rimraf)(fixtures.outputTiff);
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
it('TIFF setting xres and yres on buffer', function (done) {
|
||||
const res = 1000.0; // inputTiff has a dpi of 300 (res*2.54)
|
||||
it('TIFF setting xres and yres on buffer', () =>
|
||||
sharp(fixtures.inputTiff)
|
||||
.tiff({
|
||||
xres: (res),
|
||||
yres: (res)
|
||||
xres: 1000,
|
||||
yres: 1000
|
||||
})
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
sharp(data).metadata(function (err, metadata) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(metadata.density, res * 2.54); // convert to dpi
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
.toBuffer()
|
||||
.then(data => sharp(data)
|
||||
.metadata()
|
||||
.then(({ density }) => {
|
||||
assert.strictEqual(true,
|
||||
density === 2540 || // libvips <= 8.8.2
|
||||
density === 25400); // libvips >= 8.8.3
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
it('TIFF invalid xres value should throw an error', function () {
|
||||
assert.throws(function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user