Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 5f633c6

Browse files
authored
Merge pull request #192 from AtomLinter/arcanemagus/update-specs-ci
Update the specs and CI configuration
2 parents 67c450f + 833af46 commit 5f633c6

File tree

4 files changed

+67
-102
lines changed

4 files changed

+67
-102
lines changed

.circleci/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/linter-clang
5+
docker:
6+
- image: walberla/buildenv-ubuntu-clang:4.0
7+
environment:
8+
DISPLAY: ":99"
9+
steps:
10+
- run: apt-get update
11+
# Install some pre-requisite packages and missing dependencies from the atom package
12+
- run: apt-get --assume-yes --quiet --no-install-suggests --no-install-recommends install sudo xvfb libxss1 libasound2
13+
# Fire up a VFB to run Atom in
14+
- run: /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
15+
- checkout
16+
# Download and run the (modified) Atom CI script
17+
- run: curl -s -O https://raw.githubusercontent.com/Arcanemagus/ci/atomlinter/build-package.sh
18+
- run: chmod u+x build-package.sh
19+
- run: ./build-package.sh

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"devDependencies": {
3131
"eslint": "^3.13.0",
3232
"eslint-config-airbnb-base": "^11.0.1",
33-
"eslint-plugin-import": "^2.2.0"
33+
"eslint-plugin-import": "^2.2.0",
34+
"jasmine-fix": "^1.0.1"
3435
},
3536
"package-deps": [
3637
"linter"

spec/linter-clang-spec.js

Lines changed: 46 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,57 @@
11
'use babel';
22

3-
import * as path from 'path';
3+
// eslint-disable-next-line import/no-extraneous-dependencies
4+
import { beforeEach, it } from 'jasmine-fix';
5+
import { join } from 'path';
46

5-
const miPath = path.join(__dirname, 'files', 'missing_import');
6-
const validPath = path.join(__dirname, 'files', 'valid.c');
7+
const lint = require('../lib/main').provideLinter().lint;
78

8-
describe('The Clang provider for AtomLinter', () => {
9-
const lint = require('../lib/main').provideLinter().lint;
10-
11-
beforeEach(() => {
12-
waitsForPromise(() => atom.packages.activatePackage('linter-clang'));
13-
});
14-
15-
it('finds nothing wrong with a valid file', () => {
16-
waitsForPromise(() =>
17-
atom.workspace.open(validPath).then(editor =>
18-
lint(editor).then((messages) => {
19-
expect(messages.length).toBe(0);
20-
}),
21-
),
22-
);
23-
});
24-
25-
it('finds a fatal error in "missing_import.c"', () => {
26-
waitsForPromise(() => atom.workspace.open(`${miPath}.c`).then(
27-
editor => lint(editor).then((messages) => {
28-
expect(messages.length).toEqual(1);
29-
expect(messages[0].type).toEqual('fatal error');
30-
expect(messages[0].text).toEqual("'nothing.h' file not found");
31-
}),
32-
));
33-
});
9+
const miPath = join(__dirname, 'files', 'missing_import');
10+
const validPath = join(__dirname, 'files', 'valid.c');
3411

35-
it('finds a fatal error in "missing_import.cpp"', () => {
36-
waitsForPromise(() => atom.workspace.open(`${miPath}.cpp`).then(
37-
editor => lint(editor).then((messages) => {
38-
expect(messages.length).toEqual(1);
39-
expect(messages[0].type).toEqual('fatal error');
40-
expect(messages[0].text).toEqual("'nothing.h' file not found");
41-
}),
42-
));
12+
describe('The Clang provider for AtomLinter', () => {
13+
beforeEach(async () => {
14+
await atom.packages.activatePackage('language-c');
15+
await atom.packages.activatePackage('linter-clang');
4316
});
4417

45-
it('finds a fatal error in "missing_import.m"', () => {
46-
waitsForPromise(() => atom.workspace.open(`${miPath}.m`).then(
47-
editor => lint(editor).then((messages) => {
48-
expect(messages.length).toEqual(1);
49-
expect(messages[0].type).toEqual('fatal error');
50-
expect(messages[0].text).toEqual("'nothing.h' file not found");
51-
}),
52-
));
18+
it('finds nothing wrong with a valid file', async () => {
19+
const editor = await atom.workspace.open(validPath);
20+
const messages = await lint(editor);
21+
expect(messages.length).toBe(0);
5322
});
5423

55-
it('finds a fatal error in "missing_import.mm"', () => {
56-
waitsForPromise(() => atom.workspace.open(`${miPath}.mm`).then(
57-
editor => lint(editor).then((messages) => {
58-
expect(messages.length).toEqual(1);
59-
expect(messages[0].type).toEqual('fatal error');
60-
expect(messages[0].text).toEqual("'nothing.h' file not found");
61-
}),
62-
));
24+
describe('handles errors in different file types', () => {
25+
it('finds a fatal error in "missing_import.c"', async () => {
26+
const editor = await atom.workspace.open(`${miPath}.c`);
27+
const messages = await lint(editor);
28+
expect(messages.length).toBe(1);
29+
expect(messages[0].type).toBe('fatal error');
30+
expect(messages[0].text).toBe("'nothing.h' file not found");
31+
});
32+
33+
it('finds a fatal error in "missing_import.cpp"', async () => {
34+
const editor = await atom.workspace.open(`${miPath}.cpp`);
35+
const messages = await lint(editor);
36+
expect(messages.length).toBe(1);
37+
expect(messages[0].type).toEqual('fatal error');
38+
expect(messages[0].text).toEqual("'nothing.h' file not found");
39+
});
40+
41+
it('finds a fatal error in "missing_import.m"', async () => {
42+
const editor = await atom.workspace.open(`${miPath}.m`);
43+
const messages = await lint(editor);
44+
expect(messages.length).toBe(1);
45+
expect(messages[0].type).toEqual('fatal error');
46+
expect(messages[0].text).toEqual("'nothing.h' file not found");
47+
});
48+
49+
it('finds a fatal error in "missing_import.mm"', async () => {
50+
const editor = await atom.workspace.open(`${miPath}.mm`);
51+
const messages = await lint(editor);
52+
expect(messages.length).toBe(1);
53+
expect(messages[0].type).toEqual('fatal error');
54+
expect(messages[0].text).toEqual("'nothing.h' file not found");
55+
});
6356
});
6457
});

0 commit comments

Comments
 (0)