add travis CI

Summary: Add a Travis file that builds Infer via opam. Will add docker soon.

Reviewed By: cristianoc

Differential Revision: D3444060

fbshipit-source-id: 11432da
master
Jules Villard 9 years ago committed by Facebook Github Bot 2
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

@ -1,4 +1,4 @@
# Infer # Infer [![Build Status](https://travis-ci.org/facebook/infer.svg?branch=master)](https://travis-ci.org/facebook/infer)
[Infer](http://fbinfer.com/) is a static analysis tool for Java, [Infer](http://fbinfer.com/) is a static analysis tool for Java,
Objective-C and C, written in [OCaml](https://ocaml.org/). Objective-C and C, written in [OCaml](https://ocaml.org/).

@ -164,7 +164,7 @@ endif
all: infer all: infer
infer: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_BINIOU_DICT) infer: init $(INFERPRINT_ATDGEN_STUBS)
$(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(INFER_CONFIG_TARGETS) $(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(INFER_CONFIG_TARGETS)
$(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
@ -185,7 +185,7 @@ ifeq ($(ENABLE_OCAML_ANNOT),yes)
endif endif
ifeq ($(BUILD_C_ANALYZERS),yes) ifeq ($(BUILD_C_ANALYZERS),yes)
infer: $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) infer: $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) $(CLANG_BINIOU_DICT)
endif endif
ifeq ($(BUILD_LLVM_ANALYZERS),yes) ifeq ($(BUILD_LLVM_ANALYZERS),yes)
infer: $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml infer: $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml

@ -33,6 +33,7 @@ depends: [
"javalib" {>="2.3.1"} "javalib" {>="2.3.1"}
"extlib" {>="1.5.4"} "extlib" {>="1.5.4"}
"ounit" {>="2.0.0"} "ounit" {>="2.0.0"}
"reason" {>="0.0.5"}
] ]
depexts: [ depexts: [
[ ["ubuntu"] ["python2.7-dev"] ] [ ["ubuntu"] ["python2.7-dev"] ]

Loading…
Cancel
Save