language: cpp
compiler:
    - gcc
    - clang

before_install:

      # Install cpputest
    - pushd ..
    - wget "https://github.com/cpputest/cpputest.github.io/blob/master/releases/cpputest-3.6.tar.gz?raw=true" -O cpputest.tar.gz
    - tar -xzf cpputest.tar.gz
    - cd cpputest-3.6/
    - ./configure
    - make
    - sudo make install
    - popd

    # Install test environment for the client
    - sudo apt-get install python-virtualenv python3
    - python3 --version

    # Clone needed python dependencies
    - git clone https://github.com/cvra/serial-can-bridge.git



before_script:
    # packager requirements
    - sudo pip install -r packager/requirements.txt

    # Create client test environment
    - virtualenv --python=python3 venv
    - source venv/bin/activate
    - python --version
    - pip install -r client/requirements.txt
    - pip install mock # python 3.2 doesn't have unittest.mock

    - pushd serial-can-bridge/python
    - python setup.py install
    - popd
    - deactivate

    # Prepare bootloader build
    - ./packager/packager.py
    - mkdir build/
    - pushd build/
    - cmake ..
    - popd

script:
    # Booloader tests
    - pushd build/
    - make
    - ./tests
    - popd

    # Client tests
    - source venv/bin/activate
    - pushd client/
    - python -m unittest2
    - deactivate
    - popd


language: cpp
compiler:
    - gcc
    - clang

before_install:
    # Start by fetching latest apt-get repositories
    - sudo apt-get update

    # Install cpputest
    - pushd ..
    - wget "https://github.com/cpputest/cpputest.github.io/blob/master/releases/cpputest-3.6.tar.gz?raw=true" -O cpputest.tar.gz
    - tar -xzf cpputest.tar.gz
    - cd cpputest-3.6/
    - ./configure
    - make
    - sudo make install
    - popd

    # Install test environment for the client
    - sudo apt-get install python-virtualenv python3
    - python3 --version

    # Clone needed python dependencies
    - git clone https://github.com/cvra/serial-can-bridge.git



before_script:
    # packager requirements
    - sudo pip install -r packager/requirements.txt

    # Create client test environment
    - virtualenv --python=python3 venv
    - source venv/bin/activate
    - python --version
    - pip install -r client/requirements.txt
    - pip install mock # python 3.2 doesn't have unittest.mock

    - pushd serial-can-bridge/python
    - python setup.py install
    - popd
    - deactivate

    # Prepare bootloader build
    - ./packager/packager.py
    - mkdir build/
    - pushd build/
    - cmake ..
    - popd

script:
    # Booloader tests
    - pushd build/
    - make
    - ./tests
    - popd

    # Client tests
    - source venv/bin/activate
    - pushd client/
    - python -m unittest2
    - deactivate
    - popd


Update apt-get database before running Travis script
Update apt-get database before running Travis script
