Skip to content

Commit

Permalink
077 reduced memory usage coverity fix (#86)
Browse files Browse the repository at this point in the history
* index on master: 2e292e1 Fixed email

* Bump year

* #48 Delete objects

* #48 Unified parser interface

* #48 Release only initialized parsers

* #51 Package update

* #51 Command line

* #51 Date update

* #51 No nullptr check

* #57 Added missing vcd declaration

* #57 VCD files update

* #57 Updated doc

* #57 New version

* #63 Code coverage & Coveralls integration

* Release 4 branch

* #63 Date comparison fix

* #63 Local coverage generation

* #63 Coverage clean

* 072 std out check (#73)

* #72 Standard Output check

* #72 Test update

* #72 Strip paths

* #72 Stripped paths

* #72 Handle Windows paths

* #75 Out of memory exception (#82)

* #77 Added signal descriptors

* #77 Added prefixes

* #77 Consistency check

* #77 Cleanup

Co-authored-by: Andrzej <endrjux@users.noreply.github.com>
  • Loading branch information
WojciechRynczuk and endrjux committed Apr 21, 2020
1 parent 6d59633 commit 7626ff3
Show file tree
Hide file tree
Showing 115 changed files with 1,450 additions and 501 deletions.
147 changes: 104 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,122 @@
#The initial configuration came from the article: http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/

sudo: required
dist: trusty

python:
- "3.5"

git:
depth: 5

#Disable the default Travis submodule behavior.
git:
submodules: false

env:
global:
#COVERITY_SCAN_TOKEN
- secure: "OtVLkLQ+O18ZOxFCVTotdxWwxOqE0HcCh7LEguFPpPOp5KX9JsBrRdN8Hq689AK+GnQVuYVHkRPdiduYq8CUoLppZy0AMus7muJp2bdnotwufOIZ0r9lqzau9F4HKcdg8LBjyoHq2gnJZgNsSlrma9AGJ8nKBlVCsOJU/2DB0zJ0ufUR92otRsbKlF0TFXC2SARHYL1fgjoJBtwtKyUkHcn5/85EZjUeZGVvvRIA1oqFN2ksHv2QSevSb4auZgi8Gz4LdkQFfWa+SYDoguMYDZCkJRg4kP/ciuAxWfulroXUyAHOGvg29AwkK7hpnFCiGCxm+mOoDousBrJymuqdblwyTzy3d84i1QZQWEAaSROuPA/cpmSPHBvx+H/YTkmdPKXp46728I1wSILOclN1icWll9KhuiDMGY48e2Zmux5SKuLTjg1wzFNrVEwLeiGT7kExWXeKdPMRo/xmH2vPDlBUVrl2z12RRinpGLW0lgG70f5EJl0K30ArNXmFfFZ775nUBokc9nVgK/bjA9t2olRlOC3tzkhgZnDYp7N/AudKeOnpsWeZEQjf9p/o7SjvMvqgbGXL6kZ74n8Jkau1nKIB+9viplLpBInxEYyMSZ/9qFZf3roYmBVYRA8v6G6PsFagYnqp4vl1zGjiO49KEW1jEF56gWKRYuYHQOaebsI="
#Compilers
- CC=gcc-8
- CXX=g++-8

#Disable the default Travis submodule behavior.
git:
submodules: false
matrix:
fast_finish: true
include:
# Just run tests
- if: NOT branch = coverity_scan
os: linux
dist: trusty
sudo: required
name: "vcdMaker Tests"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
before_script:
- git submodule update --init --recursive
- cd ./sources
script:
- cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release .
- VERBOSE=1 make
- make check

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
# Code coverage
- if: NOT branch = coverity_scan
os: linux
dist: xenial
sudo: required
name: "vcdMaker Code Coverage"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
- lcov
install:
- gem install coveralls-lcov
before_script:
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 0
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-8 100
- sudo update-alternatives --auto gcov
- wget http://mirrors.kernel.org/ubuntu/pool/universe/l/lcov/lcov_1.13-4_all.deb
- sudo dpkg -i lcov_1.13-4_all.deb
- rm -f lcov_1.13-4_all.deb
- git submodule update --init --recursive
- cd ./sources
- lcov --directory . --zerocounters
script:
- cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=ON .
- VERBOSE=1 make
- make check
after_success:
- lcov --directory . --capture --output-file raw.info
- lcov --remove raw.info '/usr/*' '*/3rdParty/*' '*/test/*' --output-file coverage.info
- lcov --list coverage.info
- coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info

coverity_scan:
project:
name: vcdMaker
version: v3.0
description: Coverity Scan by Travis CI
notification_email: vcdmaker@mail.com
build_command_prepend: "cov-configure --comptype gcc --compiler g++-8 --template && cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release ."
build_command: "make"
branch_pattern: coverity_scan

# Blocklist - branches not to be built. RegEx is allowed.
branches:
except:
- r2_release
# Coverity
- if: branch = coverity_scan
os: linux
dist: trusty
sudo: required
name: "vcdMaker Coverity"
env:
- secure: "OtVLkLQ+O18ZOxFCVTotdxWwxOqE0HcCh7LEguFPpPOp5KX9JsBrRdN8Hq689AK+GnQVuYVHkRPdiduYq8CUoLppZy0AMus7muJp2bdnotwufOIZ0r9lqzau9F4HKcdg8LBjyoHq2gnJZgNsSlrma9AGJ8nKBlVCsOJU/2DB0zJ0ufUR92otRsbKlF0TFXC2SARHYL1fgjoJBtwtKyUkHcn5/85EZjUeZGVvvRIA1oqFN2ksHv2QSevSb4auZgi8Gz4LdkQFfWa+SYDoguMYDZCkJRg4kP/ciuAxWfulroXUyAHOGvg29AwkK7hpnFCiGCxm+mOoDousBrJymuqdblwyTzy3d84i1QZQWEAaSROuPA/cpmSPHBvx+H/YTkmdPKXp46728I1wSILOclN1icWll9KhuiDMGY48e2Zmux5SKuLTjg1wzFNrVEwLeiGT7kExWXeKdPMRo/xmH2vPDlBUVrl2z12RRinpGLW0lgG70f5EJl0K30ArNXmFfFZ775nUBokc9nVgK/bjA9t2olRlOC3tzkhgZnDYp7N/AudKeOnpsWeZEQjf9p/o7SjvMvqgbGXL6kZ74n8Jkau1nKIB+9viplLpBInxEYyMSZ/9qFZf3roYmBVYRA8v6G6PsFagYnqp4vl1zGjiO49KEW1jEF56gWKRYuYHQOaebsI="
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- txt2man
- doxygen
- graphviz
coverity_scan:
project:
name: vcdMaker
version: v4.0
description: Coverity Scan by Travis CI
notification_email: vcdmaker@mail.com
build_command_prepend: "cov-configure --comptype gcc --compiler g++-8 --template && cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release ."
build_command: "make"
branch_pattern: coverity_scan
before_script:
- git submodule update --init --recursive
- cd ./sources
script:
- tail cov-int/scm_log.txt

# Safelist - branches to be built.
branches:
only:
- master
- v3_release
- v4_release
- coverity_scan

before_script:
- git submodule update --init --recursive
- cd ./sources

script:
- cmake -DUSE_STATIC_PUGIXML=ON -DCMAKE_BUILD_TYPE=Release .
- VERBOSE=1 make
- make check
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 vcdMaker team
Copyright (c) 2018 vcdMaker team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![GitHub License](https://github-basic-badges.herokuapp.com/license/WojciechRynczuk/vcdMaker.svg)](https://github.com/WojciechRynczuk/vcdMaker/blob/master/LICENSE)
[![GitHub Release](https://github-basic-badges.herokuapp.com/release/WojciechRynczuk/vcdMaker.svg)](https://github.com/WojciechRynczuk/vcdMaker/releases/latest)
[![Build Status](https://travis-ci.org/WojciechRynczuk/vcdMaker.svg?branch=master)](https://travis-ci.org/WojciechRynczuk/vcdMaker)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/11276/badge.svg)](https://scan.coverity.com/projects/vcdmaker)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/11276/badge.svg)](https://scan.coverity.com/projects/vcdmaker) [![Coverage Status](https://coveralls.io/repos/github/WojciechRynczuk/vcdMaker/badge.svg)](https://coveralls.io/github/WojciechRynczuk/vcdMaker)


## Basic information
Expand Down
2 changes: 1 addition & 1 deletion development/config/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = vcdMaker
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 3.0
PROJECT_NUMBER = 4.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
9 changes: 7 additions & 2 deletions sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
# - parserSources.cmake: list of parser related files.
# - vcdMaker.cmake, vcdMerge.cmake: executable targets with source list.
# - unitTests.cmake: list of unit tests.
# - codeCoverage.cmake: enables creating coverage data. Just for Linux target.
#
# Copyright (c) 2018 vcdMaker team
# Copyright (c) 2019 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -33,7 +34,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.8)

include(FeatureSummary)

Expand All @@ -48,6 +49,8 @@ include(commonSources)

include(parserSources)

include(codeCoverage)

include(commonTarget)

include(vcdMaker)
Expand All @@ -74,4 +77,6 @@ include(doxygen)

include(pugixml)

include(clean)

feature_summary(WHAT ALL)
26 changes: 26 additions & 0 deletions sources/cmake/clean.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# clean.cmake
#
# Make clean.
#
# Copyright (c) 2019 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${MAKE_CLEAN_FILES})

65 changes: 65 additions & 0 deletions sources/cmake/codeCoverage.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# codeCoverage.cmake
#
# Code Coverage generation.
#
# Copyright (c) 2019 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

option(CODE_COVERAGE "Enable code coverage generation")
add_feature_info(GCOV CODE_COVERAGE "Code coverage generation enabled.")

if (CODE_COVERAGE)

# Build type must be Debug
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL Debug)
message(FATAL_ERROR "To generate code coverage data Debug build type must be used.")
endif()

# Generate code coverage just for the Linux target
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
add_compile_options(--coverage)
link_libraries(--coverage)
else()
message(FATAL_ERROR "Code coverage generation available only for the GNU compiler.")
endif()

# Clean code coverage html
list(APPEND MAKE_CLEAN_FILES CodeCoverage)
list(APPEND MAKE_CLEAN_FILES raw.info)
list(APPEND MAKE_CLEAN_FILES vcdMaker.coverage)

endif()

add_custom_target(coverage_clean
COMMAND rm -rf CodeCoverage
COMMAND rm -f raw.info vcdMaker.coverage
COMMAND find . -type f -name '*.gcda' -delete
COMMENT "Cleaning code coverage data."
)

add_custom_target(coverage
COMMAND mkdir CodeCoverage
COMMAND lcov --directory . --capture --rc lcov_branch_coverage=1 --output-file=raw.info
COMMAND lcov --remove raw.info '/usr/*' '*/3rdParty/*' '*/test/*' --rc lcov_branch_coverage=1 --output-file=vcdMaker.coverage
COMMAND genhtml --output-directory CodeCoverage --rc lcov_branch_coverage=1 vcdMaker.coverage
DEPENDS coverage_clean check
COMMENT "Generating code coverage."
)

7 changes: 6 additions & 1 deletion sources/cmake/commonSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# List of common source files and directories.
#
# Copyright (c) 2017 vcdMaker team
# Copyright (c) 2020 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -42,6 +42,8 @@ set(COMMON_SOURCES
${COMMON_SOURCES_DIR}/Signal.cpp
${COMMON_SOURCES_DIR}/SignalDb.cpp
${COMMON_SOURCES_DIR}/SourceRegistry.cpp
${COMMON_SOURCES_DIR}/SignalDescriptor.cpp
${COMMON_SOURCES_DIR}/SignalDescriptorRegistry.cpp
${COMMON_SOURCES_DIR}/TxtParser.cpp
${COMMON_SOURCES_DIR}/LogParser.cpp
${COMMON_SOURCES_DIR}/LineCounter.cpp
Expand Down Expand Up @@ -77,6 +79,8 @@ set(COMMON_HEADERS
${COMMON_HEADERS_DIR}/SignalStructureBuilder.h
${COMMON_HEADERS_DIR}/Signal.h
${COMMON_HEADERS_DIR}/SourceRegistry.h
${COMMON_HEADERS_DIR}/SignalDescriptor.h
${COMMON_HEADERS_DIR}/SignalDescriptorRegistry.h
${COMMON_HEADERS_DIR}/SignalDb.h
${COMMON_HEADERS_DIR}/VcdException.h
${COMMON_HEADERS_DIR}/VcdExceptionList.h
Expand All @@ -88,6 +92,7 @@ set(COMMON_HEADERS
${COMMON_HEADERS_DIR}/VCDTracer.h
${COMMON_HEADERS_DIR}/SafeUInt.h
${COMMON_HEADERS_DIR}/Timestamp.h
${COMMON_HEADERS_DIR}/OutOfMemory.h
${VERSION_HEADER})

# 3rd party directories.
Expand Down
8 changes: 5 additions & 3 deletions sources/cmake/installCpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# CPack settings.
#
# Copyright (c) 2017 vcdMaker team
# Copyright (c) 2018 vcdMaker team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -25,9 +25,10 @@
# Set Cpack.

set(AUTHOR "vcdMaker team")
set(WEBSITE "http://vcdmaker.org")
set(DESCRIPTION "Commandline tools that can generate VCD files from text logs")
set(WEBSITE "https://vcdmaker.org")
set(DESCRIPTION "Command line tools that can generate VCD files from text logs")

set(CPACK_PACKAGE_NAME "vcdMaker")
set(CPACK_PACKAGE_VENDOR ${AUTHOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Generates VCD files from text logs")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
Expand All @@ -52,5 +53,6 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${AUTHOR})
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_SECTION "electronics")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${WEBSITE})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")

include(CPack)
2 changes: 1 addition & 1 deletion sources/cmake/pugixml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (USE_STATIC_PUGIXML)

target_include_directories(${COMMON_LIB_TARGET} PUBLIC ${PUGIXML_INCLUDE_DIR})

set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PUGIXML_LIB_FILE})
list(APPEND MAKE_CLEAN_FILES ${PUGIXML_LIB_FILE})
else()
find_package(pugixml REQUIRED)
set_package_properties(pugixml PROPERTIES
Expand Down
Loading

0 comments on commit 7626ff3

Please sign in to comment.