Skip to content

Commit

Permalink
move to doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino committed Sep 30, 2024
1 parent 5347400 commit e223224
Show file tree
Hide file tree
Showing 65 changed files with 1,044 additions and 1,120 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ RequiresExpressionIndentation: OuterScope
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(catch|nanobench).*>'
- Regex: '^<(doctest|nanobench).*>'
Priority: 1
SortPriority: 1
- Regex: '^<rpp/.*/fwd.hpp>'
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ if (RPP_BUILD_TESTS OR RPP_BUILD_BENCHMARKS)

macro(add_test_with_coverage TARGET)
if (RPP_ENABLE_COVERAGE)
add_test(NAME ${TARGET} COMMAND ${CMAKE_COMMAND} -E env LLVM_PROFILE_FILE=${RPP_TEST_RESULTS_DIR}/${TARGET}.profraw $<TARGET_FILE:${TARGET}> -v high)
add_test(NAME ${TARGET} COMMAND ${CMAKE_COMMAND} -E env LLVM_PROFILE_FILE=${RPP_TEST_RESULTS_DIR}/${TARGET}.profraw $<TARGET_FILE:${TARGET}> -s)
else()
add_test(NAME ${TARGET} COMMAND $<TARGET_FILE:${TARGET}> -v high -s)
add_test(NAME ${TARGET} COMMAND $<TARGET_FILE:${TARGET}> -s)
endif()
endmacro()
endif()
Expand Down
64 changes: 32 additions & 32 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ABBREVIATE_BRIEF = "The $name class" \
the

# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# doxygen will generate a detailed SUBCASE even if there is only a brief
# description.
# The default value is: NO.

Expand Down Expand Up @@ -433,7 +433,7 @@ GROUP_NESTED_COMPOUNDS = NO

# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# type (e.g. under the Public Functions SUBCASE). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
Expand All @@ -442,7 +442,7 @@ SUBGROUPING = YES

# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# instead of on a separate page (for HTML and Man pages) or SUBCASE (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
Expand All @@ -456,7 +456,7 @@ INLINE_GROUPED_CLASSES = NO
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# Man pages) or SUBCASE (for LaTeX and RTF).
# The default value is: NO.

INLINE_SIMPLE_STRUCTS = NO
Expand Down Expand Up @@ -553,7 +553,7 @@ EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES

# This flag is only useful for Objective-C code. If set to YES, local methods,
# which are defined in the implementation section but not in the interface are
# which are defined in the implementation SUBCASE but not in the interface are
# included in the documentation. If set to NO, only methods in the interface are
# included.
# The default value is: NO.
Expand All @@ -579,7 +579,7 @@ RESOLVE_UNNAMED_PARAMS = YES
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# SUBCASE is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.

HIDE_UNDOC_MEMBERS = NO
Expand Down Expand Up @@ -755,11 +755,11 @@ GENERATE_BUGLIST = YES

GENERATE_DEPRECATEDLIST= YES

# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# The ENABLED_SUBCASES tag can be used to enable conditional documentation
# SUBCASEs, marked by \if <SUBCASE_label> ... \endif and \cond <SUBCASE_label>
# ... \endcond blocks.

ENABLED_SECTIONS =
ENABLED_SUBCASES =

# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
Expand Down Expand Up @@ -808,7 +808,7 @@ FILE_VERSION_FILTER =
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file. See also section "Changing the
# will be used as the name of the layout file. See also SUBCASE "Changing the
# layout of pages" for information.
#
# Note that if you run doxygen from a directory containing a file called
Expand Down Expand Up @@ -1253,7 +1253,7 @@ USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# See also: SUBCASE \class.
# The default value is: YES.

VERBATIM_HEADERS = YES
Expand Down Expand Up @@ -1312,7 +1312,7 @@ HTML_FILE_EXTENSION = .html
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# and then modify the file new_header.html. See also SUBCASE "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
Expand All @@ -1326,7 +1326,7 @@ HTML_HEADER =
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# SUBCASE "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.

Expand All @@ -1335,7 +1335,7 @@ HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# See also SUBCASE "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
Expand Down Expand Up @@ -1426,13 +1426,13 @@ HTML_COLORSTYLE_GAMMA = 80

HTML_DYNAMIC_MENUS = YES

# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# If the HTML_DYNAMIC_SUBCASES tag is set to YES then the generated HTML
# documentation will contain SUBCASEs that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_DYNAMIC_SECTIONS = NO
HTML_DYNAMIC_SUBCASES = NO

# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be
# dynamically folded and expanded in the generated HTML source code.
Expand Down Expand Up @@ -1632,7 +1632,7 @@ QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =

# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# project's filter SUBCASE matches. Qt Help Project / Filter Attributes (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.

Expand Down Expand Up @@ -1709,7 +1709,7 @@ FULL_SIDEBAR = NO
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# in the overview SUBCASE.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.

Expand Down Expand Up @@ -1758,7 +1758,7 @@ FORMULA_FONTSIZE = 10

# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
# to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details.
# the SUBCASE "Including formulas" for details.

FORMULA_MACROFILE =

Expand Down Expand Up @@ -1862,7 +1862,7 @@ SEARCHENGINE = YES
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
# and searching needs to be provided by external tools. See the section
# and searching needs to be provided by external tools. See the SUBCASE
# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
Expand All @@ -1880,7 +1880,7 @@ SERVER_BASED_SEARCH = NO
# Xapian (see:
# https://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# See the SUBCASE "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.

Expand All @@ -1892,7 +1892,7 @@ EXTERNAL_SEARCH = NO
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see:
# https://xapian.org/). See the section "External Indexing and Searching" for
# https://xapian.org/). See the SUBCASE "External Indexing and Searching" for
# details.
# This tag requires that the tag SEARCHENGINE is set to YES.

Expand Down Expand Up @@ -2007,7 +2007,7 @@ EXTRA_PACKAGES =
# first chapter. If it is left blank doxygen will generate a standard header. It
# is highly recommended to start with a default header using
# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
# and then modify the file new_header.tex. See also section "Doxygen usage" for
# and then modify the file new_header.tex. See also SUBCASE "Doxygen usage" for
# information on how to generate the default header that doxygen normally uses.
#
# Note: Only use a user-defined header if you know what you are doing!
Expand All @@ -2023,7 +2023,7 @@ LATEX_HEADER =
# the generated LaTeX document. The footer should contain everything after the
# last chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer. See also section "Doxygen
# special commands can be used inside the footer. See also SUBCASE "Doxygen
# usage" for information on how to generate the default footer that doxygen
# normally uses. Note: Only use a user-defined footer if you know what you are
# doing!
Expand Down Expand Up @@ -2063,7 +2063,7 @@ PDF_HYPERLINKS = YES
# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
# files. Set this option to YES, to get a higher quality PDF documentation.
#
# See also section LATEX_CMD_NAME for selecting the engine.
# See also SUBCASE LATEX_CMD_NAME for selecting the engine.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.

Expand Down Expand Up @@ -2150,7 +2150,7 @@ RTF_HYPERLINKS = NO
# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# See also SUBCASE "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.

Expand Down Expand Up @@ -2183,7 +2183,7 @@ GENERATE_MAN = NO
MAN_OUTPUT = man

# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# man pages. In case the manual SUBCASE does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
Expand Down Expand Up @@ -2425,7 +2425,7 @@ SKIP_FUNCTION_MACROS = YES
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# SUBCASE "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
Expand All @@ -2434,7 +2434,7 @@ SKIP_FUNCTION_MACROS = YES
TAGFILES =

# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# tag file that is based on the input files it reads. See SUBCASE "Linking to
# external documentation" for more information about the usage of tag files.

GENERATE_TAGFILE =
Expand Down Expand Up @@ -2473,7 +2473,7 @@ HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# Bell Labs. The other options in this SUBCASE have no effect if this option is
# set to NO
# The default value is: NO.

Expand Down Expand Up @@ -2686,7 +2686,7 @@ DIRECTORY_GRAPH = YES
DIR_GRAPH_MAX_DEPTH = 1

# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. For an explanation of the image formats see the section
# generated by dot. For an explanation of the image formats see the SUBCASE
# output formats in the documentation of the dot tool (Graphviz (see:
# https://www.graphviz.org/)).
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
Expand Down
10 changes: 5 additions & 5 deletions DoxygenLayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
<authorSUBCASE visible="yes"/>
</class>

<!-- Layout definition for a namespace page -->
Expand Down Expand Up @@ -127,7 +127,7 @@
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
<authorSUBCASE visible="yes"/>
</namespace>

<!-- Layout definition for a concept page -->
Expand All @@ -136,7 +136,7 @@
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription title=""/>
<authorsection visible="yes"/>
<authorSUBCASE visible="yes"/>
</concept>

<!-- Layout definition for a file page -->
Expand Down Expand Up @@ -174,7 +174,7 @@
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
<authorSUBCASE/>
</file>

<!-- Layout definition for a group page -->
Expand Down Expand Up @@ -226,7 +226,7 @@
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
<authorSUBCASE visible="yes"/>
</group>

<!-- Layout definition for a C++20 module page -->
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ DEALINGS IN THE SOFTWARE.
# Credits:
ReactivePlusPlus library uses:
- [PVS-Studio](https://pvs-studio.com/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
- [catch](https://github.com/catchorg/Catch2) for unit testing only, fetched automatically in case of `RPP_BUILD_TESTS` enabled
- [doctest](https://github.com/doctest/doctest) for unit testing only, fetched automatically in case of `RPP_BUILD_TESTS` enabled
- [trompeloeil](https://github.com/rollbear/trompeloeil) for mocking in unit testing only, fetched automatically in case of `RPP_BUILD_TESTS` enabled
- [nanobench](https://github.com/martinus/nanobench) for benchmarking only, fetched automatically in case of `RPP_BUILD_BENCHMARKS` enabled
- [RxCpp](https://github.com/ReactiveX/RxCpp) only for comparison of performance between RPP and RxCpp in CI benchmarks. Used as cmake dependency under option
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ endif()

# ===================== Tests ===================
if (RPP_BUILD_TESTS)
rpp_fetch_library(Catch2 https://github.com/catchorg/Catch2.git v3.6.0)
rpp_fetch_library(doctest https://github.com/doctest/doctest.git v2.4.11)
rpp_fetch_library(trompeloeil https://github.com/rollbear/trompeloeil.git main)
endif()

Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RppConan(ConanFile):
def requirements(self):
if self.options.with_tests:
self.requires("trompeloeil/47")
self.requires("catch2/3.6.0")
self.requires("doctest/2.4.11")

if self.options.with_benchmarks:
self.requires("nanobench/4.3.11")
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sonar.cfamily.llvm-cov.reportPath=build/test_results/coverage.txt
sonar.coverage.exclusions=src/tests/**/*
sonar.cpd.exclusions=src/tests/**/*
sonar.issue.ignore.allfile=a1
sonar.issue.ignore.allfile.a1.fileRegexp=#include.*catch
sonar.issue.ignore.allfile.a1.fileRegexp=#include.*doctest
4 changes: 2 additions & 2 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ macro(add_test_target target_name module files)
set(TARGET ${target_name})

add_executable(${TARGET} ${files})
target_link_libraries(${TARGET} PRIVATE Catch2::Catch2WithMain trompeloeil::trompeloeil rpp_tests_utils ${module})
target_compile_definitions(${TARGET} PRIVATE "CATCH_CONFIG_FAST_COMPILE")
target_link_libraries(${TARGET} PRIVATE doctest trompeloeil::trompeloeil rpp_tests_utils ${module})
target_compile_definitions(${TARGET} PRIVATE "DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN")
set_target_properties(${TARGET} PROPERTIES FOLDER Tests/Suites/${module})

add_test_with_coverage(${TARGET})
Expand Down
Loading

0 comments on commit e223224

Please sign in to comment.