[go: nahoru, domu]

Skip to content

Commit

Permalink
mount the source directory instead of building a new container
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Dec 20, 2017
1 parent 6db7033 commit 71fc6d6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ matrix:
- docker
env:
- label=default
before_install: &bs
before_install: &bi
- docker pull kazuho/h2o-ci:latest
- docker build -t ci -f misc/docker-ci/Dockerfile .
script:
- docker run ci
- make -f misc/docker-ci/check.mk
- os: linux
sudo: required
services:
- docker
env:
- label=fuzz
before_install: *bs
before_install: *bi
script:
- docker run ci make -f misc/docker-ci/check.mk fuzz
- make -f misc/docker-ci/check.mk fuzz
33 changes: 23 additions & 10 deletions misc/docker-ci/check.mk
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
CONTAINER_NAME=kazuho/h2o-ci:latest
SRC_DIR=/h2o
CHECK_MK=$(SRC_DIR)/misc/docker-ci/check.mk
CMAKE_ARGS=
FUZZ_ASAN=ASAN_OPTIONS=detect_leaks=0

ALL:
cmake .
make all
make check
sudo make check-as-root
docker run -v `pwd`:$(SRC_DIR) $(CONTAINER_NAME) make -f /h2o/misc/docker-ci/check.mk _check

fuzz:
sudo ln -s /usr/bin/clang-4.0 /usr/bin/clang
sudo ln -s /usr/bin/clang++-4.0 /usr/bin/clang++
ASAN_OPTIONS=detect_leaks=0 CC=clang CXX=clang++ make -f misc/docker-ci/check.mk do-fuzz
docker run -v `pwd`:$(SRC_DIR) $(CONTAINER_NAME) make -f /h2o/misc/docker-ci/check.mk _fuzz

do-fuzz:
cmake -DBUILD_FUZZER=ON .
_check:
mkdir -p build
$(MAKE) -f $(CHECK_MK) -C build _do-check CMAKE_ARGS=$(CMAKE_ARGS)

_do-check:
cmake $(CMAKE_ARGS) $(SRC_DIR)
make all
make check
sudo make check-as-root

_fuzz:
sudo ln -sf /usr/bin/clang-4.0 /usr/bin/clang
sudo ln -sf /usr/bin/clang++-4.0 /usr/bin/clang++
$(FUZZ_ASAN) CC=clang CXX=clang++ $(MAKE) -f $(CHECK_MK) _check CMAKE_ARGS=-DBUILD_FUZZER=ON
$(FUZZ_ASAN) $(MAKE) -f $(CHECK_MK) -C build _do-fuzz-extra

_do-fuzz-extra:
./h2o-fuzzer-http1 -close_fd_mask=3 -runs=1 -max_len=16384 fuzz/http1-corpus < /dev/null
./h2o-fuzzer-http2 -close_fd_mask=3 -runs=1 -max_len=16384 fuzz/http2-corpus < /dev/null
./h2o-fuzzer-url -close_fd_mask=3 -runs=1 -max_len=16384 fuzz/url-corpus < /dev/null

.PHONY: fuzz do-fuzz
.PHONY: fuzz _check _do-check _fuzz _do-fuzz-extra

0 comments on commit 71fc6d6

Please sign in to comment.