aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@gmail.com>2017-07-28 13:37:28 +0200
committerGitHub <noreply@github.com>2017-07-28 13:37:28 +0200
commit60fa4c239754a024d2cc69916f00b77f083ba96e (patch)
treea7323271aff71619c5b8a2b5f8af84bb1837b9f5
parent75342d238b55e33b4f568b1f2b60095b3d36e98d (diff)
parent8d3403cdcc085bdc764948d30eca38e6459972ca (diff)
Merge pull request #305 from xairy/up-travis
Initial travis-ci integration
-rw-r--r--.clang-format2
-rw-r--r--.travis.yml29
-rw-r--r--Makefile39
3 files changed, 57 insertions, 13 deletions
diff --git a/.clang-format b/.clang-format
index f21cd7a55..15c07f7b4 100644
--- a/.clang-format
+++ b/.clang-format
@@ -7,9 +7,9 @@ DerivePointerAlignment: false
PointerAlignment: Left
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
ColumnLimit: 0
+AlignTrailingComments: false
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..0ac605177
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,29 @@
+language: go
+dist: trusty
+
+go:
+ - 1.8.1
+
+before_install:
+ - echo $PATH
+ - export PATH=`echo $PATH | sed -e 's/:\/usr\/local\/clang-3.5.0\/bin//'`
+ - wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.4_amd64.deb
+ - mkdir ./libc
+ - dpkg-deb -x ./libstdc++6_5.4.0-6ubuntu1~16.04.4_amd64.deb ./libc
+ - export LD_LIBRARY_PATH=`pwd`/libc/usr/lib/x86_64-linux-gnu/
+ - wget http://releases.llvm.org/4.0.1/clang+llvm-4.0.1-x86_64-linux-gnu-debian8.tar.xz
+ - tar -xf ./clang+llvm-4.0.1-x86_64-linux-gnu-debian8.tar.xz
+ - sudo cp clang+llvm-4.0.1-x86_64-linux-gnu-debian8/bin/clang-format /usr/local/bin/
+ - which clang-format
+ - clang-format --version
+
+install: true
+
+script:
+ - make presubmit
+ - test -z $(git diff --name-only) # check that the diff is empty after formatting the code
+
+# If the build fails because some code in not formatted, it's nice to see the diffs after formatting.
+after_failure:
+ - git diff --name-only
+ - git diff
diff --git a/Makefile b/Makefile
index 9b719780b..d44cc5d3a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2015 syzkaller project authors. All rights reserved.
+# Copyright 2017 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
NOSTATIC ?= 0
@@ -6,16 +6,25 @@ ifeq ($(NOSTATIC), 0)
STATIC_FLAG=-static
endif
-.PHONY: all format tidy clean manager fuzzer executor execprog ci hub mutate prog2c stress extract generate repro db bin/syz-extract bin/syz-sysgen android
+.PHONY: all main tools \
+ manager fuzzer executor \
+ ci hub \
+ execprog mutate prog2c stress repro upgrade db \
+ extract generate \
+ android \
+ format tidy test arch presubmit clean
all:
+ $(MAKE) main
+ $(MAKE) tools
+
+main:
go install ./syz-manager ./syz-fuzzer
$(MAKE) manager
$(MAKE) fuzzer
- $(MAKE) execprog
$(MAKE) executor
-all-tools: execprog mutate prog2c stress repro upgrade db
+tools: execprog mutate prog2c stress repro upgrade db
# executor uses stacks of limited size, so no jumbo frames.
executor:
@@ -82,17 +91,26 @@ tidy:
# Just check for compiler warnings.
$(CC) executor/test_executor.cc -c -o /dev/null -Wparentheses -Wno-unused -Wall
-presubmit:
- $(MAKE) generate
- $(MAKE) format
- $(MAKE) executor
+test:
+ go test -short ./...
+ go test -short -race ./...
+
+arch:
GOOS=linux GOARCH=amd64 go install ./...
GOOS=linux GOARCH=arm64 go install ./...
GOOS=linux GOARCH=ppc64le go install ./...
GOOS=darwin GOARCH=amd64 go build -o /dev/null ./syz-manager
- go test -short ./...
+
+presubmit:
+ $(MAKE) generate
+ $(MAKE) all
+ $(MAKE) arch
+ $(MAKE) test
echo LGTM
+clean:
+ rm -rf ./bin/
+
android: UNAME=$(shell uname | tr '[:upper:]' '[:lower:]')
android: ANDROID_ARCH=arm64
android: ANDROID_API=24
@@ -104,6 +122,3 @@ android:
env CC="$(NDK)/toolchains/$(TOOLCHAIN)-4.9/prebuilt/$(UNAME)-x86_64/bin/$(TOOLCHAIN)-g++" \
CFLAGS="-I $(NDK)/sources/cxx-stl/llvm-libc++/include --sysroot=$(NDK)/platforms/android-$(ANDROID_API)/arch-$(ANDROID_ARCH) -O1 -g -Wall -static" \
$(MAKE) executor
-
-clean:
- rm -rf ./bin/