Skip to content

Commit

Permalink
Add wpilibsuite tests (#120)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AustinShalit authored and calcmogul committed Feb 17, 2018
1 parent d16920d commit f381c73
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,45 @@ python:

install:
- git fetch --unshallow

script:
- cd wpiformat
- python3 setup.py build
- python3 setup.py install --optimize=1 --skip-build
- python3 setup.py test
- cd .. && python3 -m wpiformat -v
- cd wpiformat
- cd ..

script:
- python3 -m wpiformat -v
- cd wpiformat
# One file
- python3 -m wpiformat -f wpiformat/__init__.py -v

# Absolute path to file
- python3 -m wpiformat -f $HOME/styleguide/wpiformat/wpiformat/__init__.py -v

# Multiple files
- python3 -m wpiformat -f wpiformat/__init__.py wpiformat/__main__.py -v

# Directory
- python3 -m wpiformat -f wpiformat -v

# Wildcard
- python3 -m wpiformat -f wpiformat/* -v

- git --no-pager diff --exit-code HEAD # Ensure formatter made no changes

jobs:
include:
- &suite-test
stage: suite test
sudo: true
before_install:
- sudo sh -c 'echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /etc/apt/sources.list.d/llvm.list'
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
- sudo apt-get update -q || true
- sudo apt-get install clang-format-5.0 -y
script:
- git clone --depth 1 git://github.com/wpilibsuite/$PROJECT && cd $PROJECT
- python3 -m wpiformat -y 2018 -clang 5.0
- git --no-pager diff --exit-code HEAD # Ensure formatter made no changes
env: PROJECT=wpiutil
- <<: *suite-test
env: PROJECT=ntcore
- <<: *suite-test
env: PROJECT=cscore
- <<: *suite-test
env: PROJECT=allwpilib

0 comments on commit f381c73

Please sign in to comment.