---
language: generic
sudo: required
dist: trusty
compiler:
  - gcc
before_install:
  - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
install:
  - sudo apt-get update
  - sudo apt-get install -qq libboost-all-dev libcrypto++-dev libsqlite3-dev pkg-config libssl-dev libpcap-dev libcap2-bin protobuf-compiler libprotobuf-dev
before_script:
  - git clone --depth=1 --recursive https://github.com/named-data/ndn-cxx.git
  - cd ndn-cxx
  - ./waf configure --debug --with-sanitizer=address
  - ./waf
  - sudo ./waf install
  - cd ..
  - sudo ldconfig
  - git clone --depth=1 --recursive https://github.com/named-data/NFD.git
  - cd NFD
  - ./waf configure --debug --with-sanitizer=address
  - ./waf
  - sudo ./waf install
  - cd ..
  - ndnsec-keygen /identity | ndnsec-cert-install -
  - sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
  - nfd-start
  - git clone --depth=1 --recursive https://github.com/named-data/ChronoSync.git
  - cd ChronoSync
  - ./waf configure --debug --with-sanitizer=address
  - ./waf
  - sudo ./waf install
  - cd ..
  - sudo ldconfig
script:
  - g++ -std=c++11 `pkg-config --cflags libndn-cxx` `pkg-config --cflags ChronoSync` test.cpp `pkg-config --libs libndn-cxx` `pkg-config --libs ChronoSync` -fsanitize=address
  - ./a.out
