Skip to content

Commit

Permalink
add a fuzzer build
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldreik committed Jun 9, 2019
1 parent 3997375 commit cc5fc03
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ matrix:
# Documentation
- env: BUILD=Doc
sudo: required
# make sure the fuzzers still build ok
- env: COMPILER=clang++-6.0 BUILD=Debug STANDARD=14 ENABLE_FUZZING=1
compiler: clang
addons:
apt:
update: true
packages:
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty
- llvm-toolchain-trusty-6.0
# g++ 6 on Linux with C++14
- env: COMPILER=g++-6 BUILD=Debug STANDARD=14
compiler: gcc
Expand Down
15 changes: 10 additions & 5 deletions support/travis-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,32 @@ def install_dependencies():
build_dir = os.path.join(fmt_dir, "_build")
test_build_dir = os.path.join(fmt_dir, "_build_test")

# Configure library.
# Configure the library.
makedirs_if_not_exist(build_dir)
cmake_flags = [
'-DCMAKE_INSTALL_PREFIX=' + install_dir, '-DCMAKE_BUILD_TYPE=' + build,
'-DCMAKE_CXX_STANDARD=' + standard
]

# make sure the fuzzers still compile
if 'ENABLE_FUZZING' in os.environ:
cmake_flags += ['-DFMT_FUZZ=ON', '-DFMT_FUZZ_LINKMAIN=On']

check_call(['cmake', '-DFMT_DOC=OFF', '-DFMT_PEDANTIC=ON', '-DFMT_WERROR=ON', fmt_dir] +
cmake_flags, cwd=build_dir)

# Build library.
check_call(['make', '-j4'], cwd=build_dir)
# Build the library.
check_call(['cmake', '--build','.'], cwd=build_dir)

# Test library.
# Test the library.
env = os.environ.copy()
env['CTEST_OUTPUT_ON_FAILURE'] = '1'
if call(['make', 'test'], env=env, cwd=build_dir):
with open(os.path.join(build_dir, 'Testing', 'Temporary', 'LastTest.log'), 'r') as f:
print(f.read())
sys.exit(-1)

# Install library.
# Install the library.
check_call(['make', 'install'], cwd=build_dir)

# Test installation.
Expand Down

0 comments on commit cc5fc03

Please sign in to comment.