mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +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': {
|
'configurations': {
|
||||||
'Release': {
|
'Release': {
|
||||||
'cflags_cc': [
|
'conditions': [
|
||||||
'-Wno-cast-function-type'
|
['OS == "linux"', {
|
||||||
],
|
'cflags_cc': [
|
||||||
'msvs_settings': {
|
'-Wno-cast-function-type'
|
||||||
'VCCLCompilerTool': {
|
]
|
||||||
'ExceptionHandling': 1
|
}],
|
||||||
}
|
['OS == "win"', {
|
||||||
},
|
'msvs_settings': {
|
||||||
'msvs_disabled_warnings': [
|
'VCCLCompilerTool': {
|
||||||
4275
|
'ExceptionHandling': 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'msvs_disabled_warnings': [
|
||||||
|
4275
|
||||||
|
]
|
||||||
|
}]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)",
|
"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.*",
|
"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-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-licensing": "license-checker --production --summary --onlyAllow=\"Apache-2.0;BSD;ISC;MIT\"",
|
||||||
"test-coverage": "./test/coverage/report.sh",
|
"test-coverage": "./test/coverage/report.sh",
|
||||||
@ -118,7 +118,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"async": "^3.1.0",
|
"async": "^3.1.0",
|
||||||
"cc": "^1.0.2",
|
"cc": "^2.0.1",
|
||||||
"decompress-zip": "^0.3.2",
|
"decompress-zip": "^0.3.2",
|
||||||
"documentation": "^12.1.3",
|
"documentation": "^12.1.3",
|
||||||
"exif-reader": "^1.0.3",
|
"exif-reader": "^1.0.3",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
const promisify = require('util').promisify;
|
||||||
const rimraf = require('rimraf');
|
const rimraf = require('rimraf');
|
||||||
|
|
||||||
const sharp = require('../../');
|
const sharp = require('../../');
|
||||||
@ -150,40 +151,40 @@ describe('TIFF', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('TIFF setting xres and yres on file', function (done) {
|
it('TIFF setting xres and yres on file', () =>
|
||||||
const res = 1000.0; // inputTiff has a dpi of 300 (res*2.54)
|
|
||||||
sharp(fixtures.inputTiff)
|
sharp(fixtures.inputTiff)
|
||||||
.tiff({
|
.tiff({
|
||||||
xres: (res),
|
xres: 1000,
|
||||||
yres: (res)
|
yres: 1000
|
||||||
})
|
})
|
||||||
.toFile(fixtures.outputTiff, (err, info) => {
|
.toFile(fixtures.outputTiff)
|
||||||
if (err) throw err;
|
.then(() => sharp(fixtures.outputTiff)
|
||||||
assert.strictEqual('tiff', info.format);
|
.metadata()
|
||||||
sharp(fixtures.outputTiff).metadata(function (err, metadata) {
|
.then(({ density }) => {
|
||||||
if (err) throw err;
|
assert.strictEqual(true,
|
||||||
assert.strictEqual(metadata.density, res * 2.54); // convert to dpi
|
density === 2540 || // libvips <= 8.8.2
|
||||||
rimraf(fixtures.outputTiff, done);
|
density === 25400); // libvips >= 8.8.3
|
||||||
});
|
return promisify(rimraf)(fixtures.outputTiff);
|
||||||
});
|
})
|
||||||
});
|
)
|
||||||
|
);
|
||||||
|
|
||||||
it('TIFF setting xres and yres on buffer', function (done) {
|
it('TIFF setting xres and yres on buffer', () =>
|
||||||
const res = 1000.0; // inputTiff has a dpi of 300 (res*2.54)
|
|
||||||
sharp(fixtures.inputTiff)
|
sharp(fixtures.inputTiff)
|
||||||
.tiff({
|
.tiff({
|
||||||
xres: (res),
|
xres: 1000,
|
||||||
yres: (res)
|
yres: 1000
|
||||||
})
|
})
|
||||||
.toBuffer(function (err, data, info) {
|
.toBuffer()
|
||||||
if (err) throw err;
|
.then(data => sharp(data)
|
||||||
sharp(data).metadata(function (err, metadata) {
|
.metadata()
|
||||||
if (err) throw err;
|
.then(({ density }) => {
|
||||||
assert.strictEqual(metadata.density, res * 2.54); // convert to dpi
|
assert.strictEqual(true,
|
||||||
done();
|
density === 2540 || // libvips <= 8.8.2
|
||||||
});
|
density === 25400); // libvips >= 8.8.3
|
||||||
});
|
})
|
||||||
});
|
)
|
||||||
|
);
|
||||||
|
|
||||||
it('TIFF invalid xres value should throw an error', function () {
|
it('TIFF invalid xres value should throw an error', function () {
|
||||||
assert.throws(function () {
|
assert.throws(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user