Skip to content

Commit f381c73

Browse files
AustinShalitcalcmogul
authored andcommitted
Add wpilibsuite tests (#120)
Travis now runs wpiformat on wpilibsuite repositories as separate build stages This ensures changes to wpiformat don't break the builds for these repositories. I couldn't figure out a way to set up clang-format on AppVeyor's Python image. So this test isn't run on AppVeyor.
1 parent d16920d commit f381c73

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

.travis.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,45 @@ python:
77

88
install:
99
- git fetch --unshallow
10-
11-
script:
1210
- cd wpiformat
1311
- python3 setup.py build
1412
- python3 setup.py install --optimize=1 --skip-build
1513
- python3 setup.py test
16-
- cd .. && python3 -m wpiformat -v
17-
- cd wpiformat
14+
- cd ..
1815

16+
script:
17+
- python3 -m wpiformat -v
18+
- cd wpiformat
1919
# One file
2020
- python3 -m wpiformat -f wpiformat/__init__.py -v
21-
2221
# Absolute path to file
2322
- python3 -m wpiformat -f $HOME/styleguide/wpiformat/wpiformat/__init__.py -v
24-
2523
# Multiple files
2624
- python3 -m wpiformat -f wpiformat/__init__.py wpiformat/__main__.py -v
27-
2825
# Directory
2926
- python3 -m wpiformat -f wpiformat -v
30-
3127
# Wildcard
3228
- python3 -m wpiformat -f wpiformat/* -v
33-
3429
- git --no-pager diff --exit-code HEAD # Ensure formatter made no changes
30+
31+
jobs:
32+
include:
33+
- &suite-test
34+
stage: suite test
35+
sudo: true
36+
before_install:
37+
- sudo sh -c 'echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /etc/apt/sources.list.d/llvm.list'
38+
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
39+
- sudo apt-get update -q || true
40+
- sudo apt-get install clang-format-5.0 -y
41+
script:
42+
- git clone --depth 1 git://github.com/wpilibsuite/$PROJECT && cd $PROJECT
43+
- python3 -m wpiformat -y 2018 -clang 5.0
44+
- git --no-pager diff --exit-code HEAD # Ensure formatter made no changes
45+
env: PROJECT=wpiutil
46+
- <<: *suite-test
47+
env: PROJECT=ntcore
48+
- <<: *suite-test
49+
env: PROJECT=cscore
50+
- <<: *suite-test
51+
env: PROJECT=allwpilib

0 commit comments

Comments
 (0)