Skip to content

Commit 6a6787a

Browse files
committed
Build Plugin Coverage Export Consle Modules
1 parent 55478ac commit 6a6787a

104 files changed

Lines changed: 1398 additions & 706 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMake/Module.cmake

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#[==[.rst:
2-
.. _vcov_module_add_module
2+
.. cmake:command:: vcov_module_add_module
3+
4+
.. code-block:: cmake
5+
6+
vcov_module_add_module(<name>
7+
CLASSES [<class>...]
8+
SOURCES [<source>...]
9+
HEADERS [<header>...]
10+
)
311
#]==]
412
function (vcov_module_add_module name)
513
cmake_parse_arguments(PARSE_ARGV 1 _vcov "" "" "CLASSES;SOURCES;HEADERS")
@@ -14,18 +22,31 @@ function (vcov_module_add_module name)
1422
add_library(${name} STATIC)
1523
endif()
1624
target_sources(${name} PRIVATE ${_vcov_SOURCES} ${_vcov_HEADERS})
17-
target_include_directories(${name} PUBLIC ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
25+
target_include_directories(${name} PUBLIC
26+
${Boost_INCLUDE_DIRS}
27+
${CMAKE_CURRENT_SOURCE_DIR}
28+
${CMAKE_CURRENT_BINARY_DIR}
29+
)
1830
target_link_libraries(${name} PUBLIC ${Boost_LIBRARIES})
1931
else()
2032
add_library(${name} INTERFACE)
2133
target_sources(${name} INTERFACE ${_vcov_HEADERS})
22-
target_include_directories(${name} INTERFACE ${Boost_INCLUDE_DIRS})
34+
target_include_directories(${name} INTERFACE
35+
${Boost_INCLUDE_DIRS}
36+
${CMAKE_CURRENT_BINARY_DIR}
37+
)
2338
endif()
2439
add_library(vcov::${name} ALIAS ${name})
2540
endfunction()
2641

2742
#[==[.rst:
28-
.. _vcov_module_add_dependencies
43+
.. cmake:command:: vcov_module_add_dependencies
44+
45+
.. code-block:: cmake
46+
47+
vcov_module_add_dependencies(<name>
48+
DEPENDENCIES [<name>...]
49+
)
2950
#]==]
3051
function (vcov_module_add_dependencies module)
3152
cmake_parse_arguments(PARSE_ARGV 1 _vcov "" "" "DEPENDENCIES")
@@ -44,7 +65,7 @@ function (vcov_module_add_dependencies module)
4465
endif()
4566
get_target_property(dep_includes ${_vcov_dep} INCLUDE_DIRECTORIES)
4667
if(dep_includes)
47-
target_include_directories(${module} PRIVATE ${dep_includes})
68+
target_include_directories(${module} PUBLIC ${dep_includes})
4869
endif()
4970
endforeach()
5071

@@ -57,15 +78,26 @@ function (vcov_module_add_dependencies module)
5778
endfunction()
5879

5980
#[==[.rst:
60-
.. vcov_add_test
81+
.. cmake:command:: vcov_add_test
82+
83+
.. code-block:: cmake
84+
85+
vcov_add_test(<name>)
6186
#]==]
6287
function (vcov_add_test module)
6388
enable_testing()
6489
add_subdirectory(Testing)
6590
endfunction()
6691

6792
#[==[.rst:
68-
.. vcov_add_test_sources
93+
.. cmake:command:: vcov_add_test_sources
94+
95+
.. code-block:: cmake
96+
97+
vcov_add_test_sources(<name>
98+
SOURCES [<source>...]
99+
DEPENDENCIES [<name>...]
100+
)
69101
#]==]
70102
function (vcov_add_test_sources module)
71103
cmake_parse_arguments(PARSE_ARGV 1 _vcov "" "" "SOURCES;DEPENDENCIES")
@@ -80,15 +112,11 @@ function (vcov_add_test_sources module)
80112
add_executable(${_vcov_source_name} ${_vcov_source})
81113
if(module_includes)
82114
target_include_directories(${_vcov_source_name} PRIVATE
83-
${module_includes}
84-
${GTEST_INCLUDE_DIRS}
85-
)
115+
${module_includes} ${GTEST_INCLUDE_DIRS})
86116
endif()
87117
if(module_deps)
88118
target_link_libraries(${_vcov_source_name} PRIVATE
89-
${module_deps}
90-
GTest::gtest GTest::gtest_main
91-
)
119+
${module_deps} GTest::gtest GTest::gtest_main)
92120
endif()
93121
add_dependencies(${_vcov_source_name} ${module})
94122
gtest_discover_tests(${_vcov_source_name})

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if(NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
2626
message(STATUS "No build type specified, using Release")
2727
endif()
2828

29-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
29+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
3030

3131
include(CTest)
3232
include(GNUInstallDirs)
@@ -36,28 +36,34 @@ include(Testing)
3636
include(Install)
3737

3838
find_package(DIA REQUIRED)
39+
find_program(PROTOC protoc REQUIRED)
3940
find_package(Boost 1.83 REQUIRED)
4041
find_package(GTest 1.17 REQUIRED)
42+
find_package(Protobuf CONFIG REQUIRED)
4143

4244
add_subdirectory(Common)
4345
add_subdirectory(Core)
4446
add_subdirectory(Platform)
4547
add_subdirectory(Export)
4648
add_subdirectory(Option)
4749
add_subdirectory(Filter)
50+
add_subdirectory(Plugin/Core)
51+
add_subdirectory(Plugin/Binary)
52+
add_subdirectory(Coverage)
53+
add_subdirectory(Plugin/Cobertura)
54+
add_subdirectory(Plugin/Html)
55+
add_subdirectory(Console)
4856

49-
#add_subdirectory(Coverage)
50-
#add_subdirectory(Utilities)
51-
# add_subdirectory(Console)
57+
#add_subdirectory(Utilities)
5258
# add_subdirectory(Testing)
53-
# add_subdirectory(Plugins)
5459
# add_subdirectory(Examples)
5560

5661
message(STATUS "")
5762
message(STATUS "Vcov ${PROJECT_VERSION} Build Summary")
5863
message(STATUS "================================================")
5964
message(STATUS "CMake Version: ${CMAKE_VERSION}")
6065
message(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
66+
message(STATUS "Protobuf Compiler: ${Protobuf_VERSION}")
6167
message(STATUS "CMake Generator: ${CMAKE_GENERATOR}")
6268
message(STATUS "Build Tests: ${VCOV_BUILD_TESTS}")
6369
message(STATUS "Build Examples: ${VCOV_BUILD_EXAMPLES}")

Console/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ vcov_module_add_dependencies(Console
1515
vcov::Export
1616
vcov::Platform
1717
vcov::Common
18+
vcov::Cobertura
19+
vcov::Plugin
20+
vcov::Binary
21+
vcov::Html
1822
)
1923
vcov_add_test(Console)
2024

2125
add_executable(vcov main.cpp)
2226
target_link_libraries(vcov PRIVATE vcov::Console)
27+
target_include_directories(vcov PRIVATE ${DIA_INCLUDE_DIRS})

Console/OpenCppCoverage.cpp

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,28 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
#include "stdafx.h"
18+
#include "BinaryExporter.hpp"
19+
#include "CoberturaExporter.hpp"
20+
#include "CodeCoverageRunner.hpp"
21+
#include "CoverageDataDeserializer.hpp"
22+
#include "CoverageDataMerger.hpp"
23+
#include "CoverageFilterSettings.hpp"
24+
#include "ExporterPluginManager.hpp"
25+
#include "ExportOptionParser.hpp"
26+
#include "HtmlExporter.hpp"
27+
#include "IExportPlugin.hpp"
28+
#include "Log.hpp"
1829
#include "OpenCppCoverage.hpp"
19-
30+
#include "Options.hpp"
31+
#include "OptionsExport.hpp"
32+
#include "OptionsParser.hpp"
33+
#include "PluginLoader.hpp"
34+
#include "ProgramOptions.hpp"
35+
#include "RunCoverageSettings.hpp"
36+
#include "Tool.hpp"
37+
#include "WarningManager.hpp"
2038
#include <iostream>
2139

22-
#include "CppCoverage/CodeCoverageRunner.hpp"
23-
#include "CppCoverage/CoverageFilterSettings.hpp"
24-
#include "CppCoverage/OptionsParser.hpp"
25-
#include "CppCoverage/Options.hpp"
26-
#include "CppCoverage/ProgramOptions.hpp"
27-
#include "CppCoverage/CoverageDataMerger.hpp"
28-
#include "CppCoverage/OptionsExport.hpp"
29-
#include "CppCoverage/RunCoverageSettings.hpp"
30-
#include "CppCoverage/ExportOptionParser.hpp"
31-
32-
#include "Exporter/Html/HtmlExporter.hpp"
33-
#include "Exporter/CoberturaExporter.hpp"
34-
#include "Exporter/Binary/BinaryExporter.hpp"
35-
#include "Exporter/Binary/CoverageDataDeserializer.hpp"
36-
#include "Exporter/Plugin/ExporterPluginManager.hpp"
37-
#include "Exporter/Plugin/PluginLoader.hpp"
38-
39-
#include "Plugin/Exporter/IExportPlugin.hpp"
40-
41-
#include "Tools/Tool.hpp"
42-
#include "Tools/Log.hpp"
43-
#include "Tools/WarningManager.hpp"
44-
4540
namespace cov = CppCoverage;
4641
namespace logging = boost::log;
4742

Console/Testing/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
vcov_add_test_sources(Console
2-
SOURCES
3-
CommandLineOptionsTest.cpp
4-
ImportExportTests.cpp
5-
)

Console/main.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1919

2020
#include "stdafx.h"
21-
2221
#include <iostream>
23-
24-
#include "Tools/MiniDump.hpp"
25-
22+
#include "MiniDump.hpp"
2623
#include "OpenCppCoverage.hpp"
2724

2825
//-----------------------------------------------------------------------------

Console/stdafx.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// OpenCppCoverage is an open source code coverage for C++.
2+
// Copyright (C) 2014 OpenCppCoverage
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
#pragma once
18+
19+
#define NOMINMAX
20+
#include <windows.h>

Core/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ vcov_module_add_dependencies(Core
3232
DEPENDENCIES
3333
vcov::Common
3434
)
35-
target_link_libraries(Core PUBLIC diaguids)
35+
message(STATUS "this are DIA libs ${DIA_LIBRARIES}")
36+
#target_link_libraries(Core PUBLIC ${DIA_LIBRARIES})
3637
target_include_directories(Core PUBLIC ${DIA_INCLUDE_DIRS})
3738
vcov_add_test(Core)

Coverage/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ vcov_module_add_dependencies(Coverage
2525
vcov::Core
2626
vcov::Common
2727
vcov::Filter
28+
vcov::Plugin
29+
vcov::Binary
30+
vcov::Platform
2831
)
29-
#vcov_add_test(Coverage)
32+
vcov_add_test(Coverage)

Coverage/CodeCoverageRunner.cpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,27 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#include "stdafx.h"
17+
#include "Address.hpp"
18+
#include "BreakPoint.hpp"
1819
#include "CodeCoverageRunner.hpp"
19-
20-
#include <sstream>
21-
#include <boost/optional.hpp>
22-
23-
#include "tools/Log.hpp"
24-
25-
#include "Plugin/Exporter/CoverageData.hpp"
20+
#include "CoverageData.hpp"
21+
#include "CoverageFilterManager.hpp"
22+
#include "CppCoverageException.hpp"
2623
#include "Debugger.hpp"
24+
#include "ExceptionHandler.hpp"
2725
#include "ExecutedAddressManager.hpp"
26+
#include "FileSystem.hpp"
27+
#include "FilterAssistant.hpp"
2828
#include "HandleInformation.hpp"
29-
#include "BreakPoint.hpp"
30-
#include "CoverageFilterManager.hpp"
31-
#include "StartInfo.hpp"
32-
#include "ExceptionHandler.hpp"
33-
#include "CppCoverageException.hpp"
34-
#include "Address.hpp"
35-
#include "RunCoverageSettings.hpp"
29+
#include "Log.hpp"
3630
#include "MonitoredLineRegister.hpp"
37-
#include "FilterAssistant.hpp"
38-
#include "FileSystem.hpp"
39-
40-
#include "Tools/WarningManager.hpp"
41-
#include "Tools/Tool.hpp"
31+
#include "RunCoverageSettings.hpp"
32+
#include "StartInfo.hpp"
33+
#include "stdafx.h"
34+
#include "Tool.hpp"
35+
#include "WarningManager.hpp"
36+
#include <boost/optional.hpp>
37+
#include <sstream>
4238

4339
namespace CppCoverage
4440
{

0 commit comments

Comments
 (0)