Skip to content

Commit

Permalink
Merge pull request #11 from DanieleDeSensi/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
DanieleDeSensi committed Oct 12, 2018
2 parents f9d2589 + ad502fc commit 97e5ca1
Show file tree
Hide file tree
Showing 300 changed files with 15,489 additions and 1,468,052 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*.gcda
*.gcno
proc.out
/src/external/*
/src/external/nornir/*
/test/googletest/*
cppcheck-report.xml
demo/dump_jpeg/dump_jpeg
Expand All @@ -25,4 +25,4 @@ test/testSMTP
test/testSSL
test/testSkype
test/testUtils

test/testSkipL7
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
language: cpp
compiler:
compiler:
- gcc
# - clang
sudo: required
dist: trusty

install:
# Cmake
- sudo apt-get install cmake
# CppCheck
- sudo apt-get install -qq cppcheck
# Pcap
- sudo apt-get install libpcap-dev
# Gcovr
- sudo apt-get install python-pip
- pip install requests[security]
- pip install --user gcovr

script:
# Runs compilation, cppcheck, tests and coverage collection
- make develcheck
- mkdir build
- cd build
- cmake ../ -DENABLE_CODECOV=ON -DENABLE_TESTS=ON -DENABLE_CPPCHECK=ON
- make && make cppcheck && (make coverage || (cat ./Testing/Temporary/LastTest.log && exit 1))
- cd ..

after_success:
# Remove unnecessary coverage files
#- rm src/nn.hpp.gcov
# codecov.io
- bash <(curl -s https://codecov.io/bash) -X gcov -f 'test/gcov/*.gcov'
# codecov.io
- bash <(curl -s https://codecov.io/bash) -f 'build/coverage.xml'

notifications:
email:
recipients:
- [email protected]
on_success: never # default: change
on_failure: always # default: always

on_failure: always # default: always
100 changes: 100 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
cmake_minimum_required(VERSION 3.5.1)
project(peafowl VERSION 1.0.0)
set (CMAKE_BUILD_TYPE Release)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_C_STANDARD 11)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")

###########
# Options #
###########
option (ENABLE_TESTS "Enables testing" OFF)
option (ENABLE_CPPCHECK "Enables cppcheck checks" OFF)
option (ENABLE_CODECOV "Enables code coverage reports" OFF)
option (ENABLE_CLANGFORMAT "Enables clang-format formatting" OFF)
option (ENABLE_DOCS "Enables documentation generation" OFF)

add_compile_options(-Wall -finline-functions -O3)

find_package(PCAP)

# This must be the first thing done, since COVERAGE_COMPILER_FLAGS must be used by all the targets
###########
# codecov #
###########
if (ENABLE_CODECOV)
set (CMAKE_BUILD_TYPE Debug)
if (NOT ENABLE_TESTS)
message (FATAL_ERROR "You need to define -DENABLE_TESTS=ON when you use -DENABLE_CODECOV=ON")
endif()
include(CodeCoverage)
APPEND_COVERAGE_COMPILER_FLAGS()
endif (ENABLE_CODECOV)

###########
# Library #
###########
add_subdirectory(src)
add_subdirectory(demo)

############
# cppcheck #
############
if (ENABLE_CPPCHECK)
include(cmake/cppcheck.cmake)
endif (ENABLE_CPPCHECK)

###########
# Testing #
###########
if (ENABLE_TESTS)
if (NOT PCAP_FOUND)
message(FATAL_ERROR "libpcap needs to be installed to run tests")
else()
enable_testing()
add_subdirectory(test)
endif (NOT PCAP_FOUND)
endif (ENABLE_TESTS)

###########
# codecov #
###########
if (ENABLE_CODECOV)
set(COVERAGE_GCOVR_EXCLUDES 'src/external/*' 'test/*' 'demo/*' 'experiments/*')
SETUP_TARGET_FOR_COVERAGE_GCOVR_XML(
NAME coverage
EXECUTABLE make test
DEPENDENCIES peafowl_static
)
endif (ENABLE_CODECOV)

################
# clang-format #
################
if (ENABLE_CLANGFORMAT)
include(cmake/clang_format.cmake)
endif (ENABLE_CLANGFORMAT)

#######
# Doc #
#######
if (ENABLE_DOCS)
find_package(Doxygen)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile)

# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")

add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message(WARNING "Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif (ENABLE_DOCS)
60 changes: 0 additions & 60 deletions Makefile

This file was deleted.

Loading

0 comments on commit 97e5ca1

Please sign in to comment.