Skip to content

Commit

Permalink
CI: Upgrade to latest FreeBSD, improve test resilience
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Dec 17, 2023
1 parent 021d637 commit 5cd787b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
freebsd_instance:
image_family: freebsd-13-2
image_family: freebsd-14-0-snap

task:
name: FreeBSD
Expand All @@ -10,7 +10,8 @@ task:
- pkg update -f
- pkg upgrade -y
- pkg install -y devel/git devel/pkgconf graphics/vips www/node20 www/npm
- pkg-config --modversion vips-cpp
install_script:
- npm install --build-from-source
test_script:
- npm test
- npx mocha --no-config --spec=test/unit/io.js --timeout=30000
14 changes: 10 additions & 4 deletions test/unit/libvips.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,28 @@ describe('libvips binaries', function () {
describe('Build time directories', () => {
it('sharp-libvips include', () => {
const dir = libvips.buildSharpLibvipsIncludeDir();
assert.strictEqual(fs.statSync(dir).isDirectory(), true);
if (dir) {
assert.strictEqual(fs.statSync(dir).isDirectory(), true);
}
});
it('sharp-libvips cplusplus', () => {
const dir = libvips.buildSharpLibvipsCPlusPlusDir();
assert.strictEqual(fs.statSync(dir).isDirectory(), true);
if (dir) {
assert.strictEqual(fs.statSync(dir).isDirectory(), true);
}
});
it('sharp-libvips lib', () => {
const dir = libvips.buildSharpLibvipsLibDir();
assert.strictEqual(fs.statSync(dir).isDirectory(), true);
if (dir) {
assert.strictEqual(fs.statSync(dir).isDirectory(), true);
}
});
});

describe('Runtime detection', () => {
it('platform', () => {
const [platform] = libvips.runtimePlatformArch().split('-');
assert.strict(['darwin', 'linux', 'linuxmusl', 'win32'].includes(platform));
assert.strict(['darwin', 'freebsd', 'linux', 'linuxmusl', 'win32'].includes(platform));
});
it('arch', () => {
const [, arch] = libvips.runtimePlatformArch().split('-');
Expand Down

0 comments on commit 5cd787b

Please sign in to comment.