Summary: Add a Travis file that builds Infer via opam. Will add docker soon. Reviewed By: cristianoc Differential Revision: D3444060 fbshipit-source-id: 11432damaster
parent
6304e30f5a
commit
8796f2c7ef
@ -0,0 +1,26 @@
|
|||||||
|
sudo: required
|
||||||
|
language: c
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
services: docker
|
||||||
|
osx_image: xcode7.3
|
||||||
|
before_install:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install opam; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam init; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam switch 4.02.3; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then eval `opam config env`; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam update; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam install -y depext; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam pin add -y merlin 'https://github.com/the-lambda-church/merlin.git#reason-0.0.1'; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam pin add -y merlin_extend 'https://github.com/let-def/merlin-extend.git#reason-0.0.1'; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam pin add -y --no-action reason 'https://github.com/facebook/reason.git#0.0.6'; fi
|
||||||
|
install:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam pin add -y --no-action infer .; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam depext infer; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam install -y infer; fi
|
||||||
|
script:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/local_install_tests.sh; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./.travis/docker_tests.sh; fi
|
||||||
|
- git diff --exit-code
|
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the BSD style license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
# assumes we are in .travis/
|
||||||
|
cd "${SCRIPT_DIR}/../docker"
|
||||||
|
|
||||||
|
docker build -t infer .
|
||||||
|
|
||||||
|
echo 'Running `infer -- javac /infer/examples/Hello.java`'
|
||||||
|
docker run -t infer \
|
||||||
|
/bin/bash -c \
|
||||||
|
'infer -- javac /infer/examples/Hello.java | grep -q "NULL_DEREFERENCE: *1"'
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo 'Running `infer -- clang -c /infer/examples/hello.c`'
|
||||||
|
docker run -t infer \
|
||||||
|
/bin/bash -c \
|
||||||
|
'infer -- clang -c /infer/examples/hello.c | grep -q "NULL_DEREFERENCE: *1"'
|
||||||
|
echo
|
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the BSD style license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
# go to the root of the repo -- assumes we are in .travis/
|
||||||
|
cd "${SCRIPT_DIR}/.."
|
||||||
|
|
||||||
|
echo 'Running `infer -- javac examples/Hello.java`'
|
||||||
|
infer -- javac examples/Hello.java | grep -q 'NULL_DEREFERENCE: *1'
|
||||||
|
echo
|
Loading…
Reference in new issue