From 375896cc06bd149e992857ff5fdab6e03ec51bf5 Mon Sep 17 00:00:00 2001 From: Michael M Date: Thu, 7 Sep 2017 21:52:42 -0700 Subject: [PATCH 1/3] cmocka: update to cmocka-1.1.1 This fixes a CMake error on macOS when trying to link against RT_LIBRARY, which isn't found. Signed-off-by: Michael M --- third_party/cmocka/.clang_complete | 1 + third_party/cmocka/.gitignore | 4 +- third_party/cmocka/.ycm_extra_conf.py | 109 + third_party/cmocka/CMakeLists.txt | 10 +- third_party/cmocka/CPackConfig.cmake | 2 +- third_party/cmocka/ChangeLog | 18 + third_party/cmocka/ConfigureChecks.cmake | 26 +- third_party/cmocka/INSTALL | 29 +- .../cmake/Modules/DefineCompilerFlags.cmake | 2 +- third_party/cmocka/config.h.cmake | 5 +- third_party/cmocka/doc/Doxyfile.in | 332 +-- third_party/cmocka/doc/doxy.config.in | 1917 ----------------- third_party/cmocka/doc/mainpage.dox | 7 +- third_party/cmocka/example/CMakeLists.txt | 59 +- .../cmocka/example/allocate_module_test.c | 6 +- .../cmocka/example/chef_wrap/CMakeLists.txt | 4 +- .../cmocka/example/customer_database_test.c | 2 +- third_party/cmocka/example/fixture_test.c | 37 - third_party/cmocka/include/cmocka.h | 225 +- third_party/cmocka/src/cmocka.c | 441 +++- third_party/cmocka/src/cmocka.def | 2 + third_party/cmocka/tests/CMakeLists.txt | 105 +- .../cmocka/tests/test_exception_handler.c | 2 + third_party/cmocka/tests/test_fixtures.c | 37 + .../cmocka/tests/test_group_fixtures.c | 2 + .../cmocka/tests/test_group_setup_assert.c | 37 + .../run_tests.c => tests/test_groups.c} | 29 +- third_party/cmocka/tests/test_ordering.c | 112 + third_party/cmocka/tests/test_ordering_fail.c | 95 + third_party/cmocka/tests/test_returns.c | 69 + third_party/cmocka/tests/test_returns_fail.c | 77 + 31 files changed, 1574 insertions(+), 2229 deletions(-) create mode 100644 third_party/cmocka/.ycm_extra_conf.py delete mode 100644 third_party/cmocka/doc/doxy.config.in delete mode 100644 third_party/cmocka/example/fixture_test.c create mode 100644 third_party/cmocka/tests/test_group_setup_assert.c rename third_party/cmocka/{example/run_tests.c => tests/test_groups.c} (64%) create mode 100644 third_party/cmocka/tests/test_ordering.c create mode 100644 third_party/cmocka/tests/test_ordering_fail.c create mode 100644 third_party/cmocka/tests/test_returns.c create mode 100644 third_party/cmocka/tests/test_returns_fail.c diff --git a/third_party/cmocka/.clang_complete b/third_party/cmocka/.clang_complete index 30679be..6177904 100644 --- a/third_party/cmocka/.clang_complete +++ b/third_party/cmocka/.clang_complete @@ -1 +1,2 @@ -Iinclude +-Iobj diff --git a/third_party/cmocka/.gitignore b/third_party/cmocka/.gitignore index e4254b6..3944fce 100644 --- a/third_party/cmocka/.gitignore +++ b/third_party/cmocka/.gitignore @@ -1,5 +1,7 @@ *.swp *~$ -build tags cscope.* +.ycm_extra_conf.pyc +/build +/obj* diff --git a/third_party/cmocka/.ycm_extra_conf.py b/third_party/cmocka/.ycm_extra_conf.py new file mode 100644 index 0000000..8305a8b --- /dev/null +++ b/third_party/cmocka/.ycm_extra_conf.py @@ -0,0 +1,109 @@ +import os +import ycm_core + +flags = [ +'-Wall', +'-Wextra', +'-Werror', +'-x', 'c', +'-Iinclude', +] + +# Set this to the absolute path to the folder (NOT the file!) containing the +# compile_commands.json file to use that instead of 'flags'. See here for +# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html +# +# Most projects will NOT need to set this to anything; you can just change the +# 'flags' list of compilation flags. Notice that YCM itself uses that approach. +compilation_database_folder = 'obj' + +if os.path.exists( compilation_database_folder ): + database = ycm_core.CompilationDatabase( compilation_database_folder ) +else: + database = None + +SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] + +def DirectoryOfThisScript(): + return os.path.dirname( os.path.abspath( __file__ ) ) + + +def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): + if not working_directory: + return list( flags ) + new_flags = [] + make_next_absolute = False + path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] + for flag in flags: + new_flag = flag + + if make_next_absolute: + make_next_absolute = False + if not flag.startswith( '/' ): + new_flag = os.path.join( working_directory, flag ) + + for path_flag in path_flags: + if flag == path_flag: + make_next_absolute = True + break + + if flag.startswith( path_flag ): + path = flag[ len( path_flag ): ] + new_flag = path_flag + os.path.join( working_directory, path ) + break + + if new_flag: + new_flags.append( new_flag ) + return new_flags + + +def IsHeaderFile( filename ): + extension = os.path.splitext( filename )[ 1 ] + return extension in [ '.h', '.hxx', '.hpp', '.hh' ] + + +def GetCompilationInfoForFile( filename ): + # The compilation_commands.json file generated by CMake does not have entries + # for header files. So we do our best by asking the db for flags for a + # corresponding source file, if any. If one exists, the flags for that file + # should be good enough. + if IsHeaderFile( filename ): + basename = os.path.splitext( filename )[ 0 ] + for extension in SOURCE_EXTENSIONS: + replacement_file = basename + extension + if os.path.exists( replacement_file ): + compilation_info = database.GetCompilationInfoForFile( + replacement_file ) + if compilation_info.compiler_flags_: + return compilation_info + return None + return database.GetCompilationInfoForFile( filename ) + + +def FlagsForFile( filename, **kwargs ): + if database: + # Bear in mind that compilation_info.compiler_flags_ does NOT return a + # python list, but a "list-like" StringVec object + compilation_info = GetCompilationInfoForFile( filename ) + if not compilation_info: + return None + + final_flags = MakeRelativePathsInFlagsAbsolute( + compilation_info.compiler_flags_, + compilation_info.compiler_working_dir_ ) + + # NOTE: This is just for YouCompleteMe; it's highly likely that your project + # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR + # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT. + try: + final_flags.remove( '-stdlib=libc++' ) + except ValueError: + pass + else: + relative_to = DirectoryOfThisScript() + final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + + return { + 'flags': final_flags, + 'do_cache': True + } diff --git a/third_party/cmocka/CMakeLists.txt b/third_party/cmocka/CMakeLists.txt index 70a8ad1..ac224ff 100644 --- a/third_party/cmocka/CMakeLists.txt +++ b/third_party/cmocka/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 2.6.0) set(APPLICATION_NAME ${PROJECT_NAME}) set(APPLICATION_VERSION_MAJOR "1") -set(APPLICATION_VERSION_MINOR "0") +set(APPLICATION_VERSION_MINOR "1") set(APPLICATION_VERSION_PATCH "1") set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}") @@ -19,7 +19,7 @@ set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINO # Increment AGE. Set REVISION to 0 # If the source code was changed, but there were no interface changes: # Increment REVISION. -set(LIBRARY_VERSION "0.3.1") +set(LIBRARY_VERSION "0.4.1") set(LIBRARY_SOVERSION "0") # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked @@ -34,6 +34,7 @@ include(DefineCompilerFlags) include(DefineInstallationPaths) include(DefineOptions.cmake) include(CPackConfig.cmake) +include(CheckSymbolExists) # disallow in-source build include(MacroEnsureOutOfSourceBuild) @@ -43,6 +44,11 @@ macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source buil include(ConfigureChecks.cmake) configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +# MinGW DLL Naming Workaround +if (MINGW) + set(CMAKE_SHARED_LIBRARY_PREFIX "") +endif (MINGW) + # check subdirectories add_subdirectory(doc) add_subdirectory(include) diff --git a/third_party/cmocka/CPackConfig.cmake b/third_party/cmocka/CPackConfig.cmake index 5666c5a..8d427a3 100644 --- a/third_party/cmocka/CPackConfig.cmake +++ b/third_party/cmocka/CPackConfig.cmake @@ -19,7 +19,7 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO ### source generator set(CPACK_SOURCE_GENERATOR "TGZ") -set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;obj*;tags;cscope.*;.ycm_extra_conf.pyc") +set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/obj*;tags;cscope.*;.ycm_extra_conf.pyc") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") if (WIN32) diff --git a/third_party/cmocka/ChangeLog b/third_party/cmocka/ChangeLog index 819d10f..aa5835a 100644 --- a/third_party/cmocka/ChangeLog +++ b/third_party/cmocka/ChangeLog @@ -1,3 +1,21 @@ +Fri Apr 07 2016 Andreas Schneider + * cmocka: version 1.1.1 + * Fixed TAP output + * Fixed cmocka on Windows x64 + * Fixed xUnit output durations + +Wed Sep 21 2016 Andreas Schneider + * cmocka: version 1.1.0 + * Added support to catch multiple exceptions + * Added support to verify call ordering + * Added support to pass initial data to test cases + * Added will_return_maybe() for ignoring mock returns + * Added subtests for groups using TAP output + * Added support to write multiple XML files for groups + * Improved documentation + * Fixed XML output generataion + * Fixed Windows builds with VS2015 + Thu Mar 12 2015 Andreas Schneider * cmocka: version 1.0.1 * Added a macro for assert_ptr_equal(). diff --git a/third_party/cmocka/ConfigureChecks.cmake b/third_party/cmocka/ConfigureChecks.cmake index c0dd13d..9bdc6f8 100644 --- a/third_party/cmocka/ConfigureChecks.cmake +++ b/third_party/cmocka/ConfigureChecks.cmake @@ -76,6 +76,7 @@ check_function_exists(exit HAVE_EXIT) check_function_exists(fprintf HAVE_FPRINTF) check_function_exists(free HAVE_FREE) check_function_exists(longjmp HAVE_LONGJMP) +check_function_exists(siglongjmp HAVE_SIGLONGJMP) check_function_exists(malloc HAVE_MALLOC) check_function_exists(memcpy HAVE_MEMCPY) check_function_exists(memset HAVE_MEMSET) @@ -83,9 +84,7 @@ check_function_exists(printf HAVE_PRINTF) check_function_exists(setjmp HAVE_SETJMP) check_function_exists(signal HAVE_SIGNAL) check_function_exists(strsignal HAVE_STRSIGNAL) -check_function_exists(sprintf HAVE_SNPRINTF) check_function_exists(strcmp HAVE_STRCMP) -check_function_exists(vsnprintf HAVE_VSNPRINTF) check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) if (WIN32) @@ -93,14 +92,17 @@ if (WIN32) check_function_exists(_vsnprintf HAVE__VSNPRINTF) check_function_exists(_snprintf HAVE__SNPRINTF) check_function_exists(_snprintf_s HAVE__SNPRINTF_S) + check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF) + check_symbol_exists(vsnprintf stdio.h HAVE_VSNPRINTF) +else (WIN32) + check_function_exists(sprintf HAVE_SNPRINTF) + check_function_exists(vsnprintf HAVE_VSNPRINTF) endif (WIN32) find_library(RT_LIBRARY rt) -if (RT_LIBRARY) - set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY}) -endif (RT_LIBRARY) - -set(CMOCKA_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "cmocka required system libraries") +if (RT_LIBRARY AND NOT LINUX) + set(CMOCKA_REQUIRED_LIBRARIES ${RT_LIBRARY} CACHE INTERNAL "cmocka required system libraries") +endif () # OPTIONS check_c_source_compiles(" @@ -120,9 +122,10 @@ int main(void) { endif(WIN32) if (HAVE_TIME_H AND HAVE_STRUCT_TIMESPEC AND HAVE_CLOCK_GETTIME) - set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY}) + if (RT_LIBRARY) + set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY}) + endif() - message(STATUS "CMAKE_REQUIRED_INCLUDES=${CMAKE_REQUIRED_INCLUDES} CMAKE_REQUIRED_LIBRARIES=${CMAKE_REQUIRED_LIBRARIES}") check_c_source_compiles(" #include @@ -132,8 +135,11 @@ int main(void) { clock_gettime(CLOCK_REALTIME, &ts); return 0; -}" HAVE_CLOCK_GETTIME_REALTIME) +}" HAVE_CLOCK_REALTIME) + + # reset cmake requirements set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) endif () # ENDIAN diff --git a/third_party/cmocka/INSTALL b/third_party/cmocka/INSTALL index 9cb1b03..8b438d5 100644 --- a/third_party/cmocka/INSTALL +++ b/third_party/cmocka/INSTALL @@ -21,7 +21,12 @@ GNU/Linux, MacOS X, MSYS/MinGW: cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .. make -On Windows you should choose a makefile gernerator with -G. +On Windows you should choose a makefile gernerator with -G, for example: + + cmake -G "Visual Studio 12 2013" -DCMAKE_BUILD_TYPE=Debug /path/to/source + +You can also use the CMake GUI which is shipped with CMake. It will list all +available generators for MSVC on Windows. ### CMake standard options Here is a list of the most interesting options provided out of the box by @@ -66,6 +71,28 @@ The cmocka library can be found in the `build/src` directory. You can run the binaries in `build/examples/*` which is a are exsample tests. +## Testing + +As mention above you can turn on the unit tests and make it possible to easily +execute them: + +`cmake -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON ..` + +After that you can simply call `make test` in the build directory or if you +want more output simply call `ctest -V`. + +If you want to enable the generation of coverage files you can do this by +using the following options: + +`cmake -DCMAKE_BUILD_TYPE=Profiling -DUNIT_TESTING=ON ..` + +After building it you will see that you have several coverage options in + +`make help` + +You should have `make ExperimentalCoverage` and running it will create +coverage files. The result is stored in Testing directory. + ## About this document This document is written using [Markdown][] syntax, making it possible to diff --git a/third_party/cmocka/cmake/Modules/DefineCompilerFlags.cmake b/third_party/cmocka/cmake/Modules/DefineCompilerFlags.cmake index 14d473f..cef5dc1 100644 --- a/third_party/cmocka/cmake/Modules/DefineCompilerFlags.cmake +++ b/third_party/cmocka/cmake/Modules/DefineCompilerFlags.cmake @@ -13,7 +13,7 @@ if (UNIX AND NOT WIN32) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -pedantic-errors") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -Wundef") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -Wundef -Wstrict-prototypes") # with -fPIC check_c_compiler_flag("-fPIC" WITH_FPIC) diff --git a/third_party/cmocka/config.h.cmake b/third_party/cmocka/config.h.cmake index 78cce7a..1aaabb5 100644 --- a/third_party/cmocka/config.h.cmake +++ b/third_party/cmocka/config.h.cmake @@ -110,6 +110,9 @@ /* Define to 1 if you have the `longjmp' function. */ #cmakedefine HAVE_LONGJMP 1 +/* Define to 1 if you have the `siglongjmp' function. */ +#cmakedefine HAVE_SIGLONGJMP 1 + /* Define to 1 if you have the `malloc' function. */ #cmakedefine HAVE_MALLOC 1 @@ -155,7 +158,7 @@ #cmakedefine HAVE_MSVC_THREAD_LOCAL_STORAGE 1 /* Check if we have CLOCK_REALTIME for clock_gettime() */ -#cmakedefine HAVE_CLOCK_GETTIME_REALTIME 1 +#cmakedefine HAVE_CLOCK_REALTIME 1 /*************************** ENDIAN *****************************/ diff --git a/third_party/cmocka/doc/Doxyfile.in b/third_party/cmocka/doc/Doxyfile.in index b0f9f63..221beba 100644 --- a/third_party/cmocka/doc/Doxyfile.in +++ b/third_party/cmocka/doc/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.8 +# Doxyfile 1.8.12 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -46,10 +46,10 @@ PROJECT_NUMBER = @APPLICATION_VERSION@ PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -58,9 +58,9 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@ +OUTPUT_DIRECTORY = "@CMAKE_CURRENT_BINARY_DIR@" -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -93,14 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -145,7 +145,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ +STRIP_FROM_PATH = "@CMAKE_SOURCE_DIR@" # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@ +STRIP_FROM_INC_PATH = "@CMAKE_SOURCE_DIR@" # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -215,9 +215,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -286,7 +286,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -303,10 +303,19 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -346,13 +355,20 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +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 @@ -411,7 +427,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -421,35 +437,35 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = NO -# This flag is only useful for Objective-C code. When set to YES local methods, +# 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 -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -474,21 +490,21 @@ HIDE_UNDOC_MEMBERS = YES # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be +# (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -502,7 +518,7 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = @CMAKE_INTERNAL_DOC@ # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -511,12 +527,19 @@ INTERNAL_DOCS = @CMAKE_INTERNAL_DOC@ CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -544,14 +567,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -596,27 +619,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -641,8 +662,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -706,7 +727,7 @@ CITE_BIB_FILES = QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -714,7 +735,7 @@ QUIET = YES WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -731,12 +752,18 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -760,12 +787,12 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_SOURCE_DIR@/include \ - @CMAKE_SOURCE_DIR@/src \ - @CMAKE_SOURCE_DIR@/doc +INPUT = "@CMAKE_SOURCE_DIR@/include" \ + "@CMAKE_SOURCE_DIR@/src" \ + "@CMAKE_SOURCE_DIR@/doc" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -778,12 +805,17 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = *.cpp \ *.cc \ @@ -841,7 +873,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/example +EXAMPLE_PATH = "@CMAKE_SOURCE_DIR@/example" # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -883,6 +915,10 @@ IMAGE_PATH = # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -892,11 +928,15 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -956,7 +996,7 @@ REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -1033,7 +1073,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1099,10 +1139,10 @@ HTML_STYLESHEET = # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. +# standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra stylesheet files is of importance (e.g. the last -# stylesheet in the list overrules the setting of the previous ones in the +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1119,7 +1159,7 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 @@ -1150,8 +1190,9 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO @@ -1247,28 +1288,28 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1382,7 +1423,7 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1410,7 +1451,7 @@ ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1439,7 +1480,7 @@ FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1525,7 +1566,7 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # @@ -1538,7 +1579,7 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. @@ -1576,7 +1617,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = @DOXYFILE_LATEX@ @@ -1607,7 +1648,7 @@ LATEX_CMD_NAME = @LATEX_COMPILER@ MAKEINDEX_CMD_NAME = @MAKEINDEX_COMPILER@ -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1625,9 +1666,12 @@ COMPACT_LATEX = NO PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1642,9 +1686,9 @@ EXTRA_PACKAGES = # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, # $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string, -# for the replacement values of the other commands the user is refered to -# HTML_HEADER. +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = @@ -1660,6 +1704,17 @@ LATEX_HEADER = LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1678,7 +1733,7 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1719,11 +1774,19 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1738,7 +1801,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1775,11 +1838,21 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1823,7 +1896,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1837,7 +1910,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1850,7 +1923,7 @@ XML_PROGRAMLISTING = YES # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1864,7 +1937,7 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the # program listings (including syntax highlighting and cross-referencing # information) to the DOCBOOK output. Note that enabling this will significantly # increase the size of the DOCBOOK output. @@ -1877,10 +1950,10 @@ DOCBOOK_PROGRAMLISTING = NO # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1889,7 +1962,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1897,7 +1970,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1905,9 +1978,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1927,14 +2000,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1950,7 +2023,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -2025,22 +2098,23 @@ TAGFILES = # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = @CMAKE_CURRENT_BINARY_DIR@/html/@PROJECT_NAME@.TAGFILE +GENERATE_TAGFILE = "@CMAKE_CURRENT_BINARY_DIR@/html/@PROJECT_NAME@.TAGFILE" -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = YES -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2057,7 +2131,7 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2082,7 +2156,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2155,7 +2229,7 @@ COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2207,7 +2281,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2218,7 +2293,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2241,11 +2317,15 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2293,10 +2373,14 @@ DIAFILE_DIRS = # PlantUML is not used or called during a preprocessing step. Doxygen will # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -# This tag requires that the tag HAVE_DOT is set to YES. PLANTUML_JAR_PATH = +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2333,7 +2417,7 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2350,7 +2434,7 @@ DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/third_party/cmocka/doc/doxy.config.in b/third_party/cmocka/doc/doxy.config.in deleted file mode 100644 index 5de47b1..0000000 --- a/third_party/cmocka/doc/doxy.config.in +++ /dev/null @@ -1,1917 +0,0 @@ -# Doxyfile 1.8.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed -# in front of the TAG it is preceding . -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = @APPLICATION_NAME@ - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @APPLICATION_VERSION@ - -# 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 quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@ - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, -# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, -# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - 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 -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. Note that you specify absolute paths here, but also -# relative paths, which will be relative from the directory where doxygen is -# started. - -STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@ - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, -# and language is one of the parsers supported by doxygen: IDL, Java, -# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, -# C++. For instance to make doxygen treat .inc files as Fortran files (default -# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note -# that for custom extensions you also need to set FILE_PATTERNS otherwise the -# files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES (the -# default) will make doxygen replace the get and set methods by a property in -# the documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) 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 subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -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 and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields or simple typedef fields will be shown -# inline in 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 (the default), structs, classes, and unions are shown on a separate -# page (for HTML and Man pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = YES - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can -# be an expensive process and often the same symbol appear multiple times in -# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too -# small doxygen will become slower. If the cache is too large, memory is wasted. -# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid -# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 -# symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) 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. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = @CMAKE_INTERNAL_DOC@ - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = YES - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -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 ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# 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. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. Do not use -# file names with spaces, bibtex cannot handle them. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = @CMAKE_SOURCE_DIR@/include \ - @CMAKE_SOURCE_DIR@/src \ - @CMAKE_SOURCE_DIR@/doc - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.cpp \ - *.cc \ - *.c \ - *.h \ - *.hh \ - *.hpp \ - *.dox - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = */.git/* \ - */.svn/* \ - */cmake/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/example - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = *.c \ - *.h \ - INSTALL \ - DEPENDENCIES \ - CHANGELOG \ - LICENSE \ - LGPL - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = YES - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be ignored. -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) 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. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 2 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -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. Note that it is recommended to use -# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this -# tag will in the future become obsolete. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional -# user-defined cascading style sheet that is included after the standard -# style sheets created by doxygen. Using this option one can overrule -# certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more -# robust against future updates. Doxygen will copy the style sheet file to -# the output directory. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = NO - -# 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 -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely -# identify the documentation publisher. This should be a reverse domain-name -# style string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -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. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that 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. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and -# SVG. The default value is HTML-CSS, which is slower, but has the best -# compatibility. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. -# However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript -# pieces of code that will be used on startup of the MathJax code. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. -# There are two flavours of web server based search 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 manual for details. - -SERVER_BASED_SEARCH = NO - -# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP -# script for searching. Instead the search results are written to an XML file -# which needs to be processed by an external indexer. Doxygen will invoke an -# external search engine pointed to by the SEARCHENGINE_URL option to obtain -# the search results. Doxygen ships with an example indexer (doxyindexer) and -# search engine (doxysearch.cgi) which are based on the open source search -# engine library Xapian. See the manual for configuration details. - -EXTERNAL_SEARCH = NO - -# The SEARCHENGINE_URL should point to a search engine hosted by a web server -# which will returned the search results when EXTERNAL_SEARCH is enabled. -# Doxygen ships with an example search engine (doxysearch) which is based on -# the open source search engine library Xapian. See the manual for configuration -# details. - -SEARCHENGINE_URL = - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed -# search data is written to a file for indexing by an external tool. With the -# SEARCHDATA_FILE tag the name of this file can be specified. - -SEARCHDATA_FILE = searchdata.xml - -# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the -# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is -# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple -# projects and redirect the results back to the right project. - -EXTERNAL_SEARCH_ID = - -# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen -# projects other than the one defined by this configuration file, but that are -# all added to the same external search index. Each project needs to have a -# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id -# of to a relative location where the documentation can be found. -# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... - -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = @DOXYFILE_LATEX@ - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = @LATEX_COMPILER@ - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = @MAKEINDEX_COMPILER@ - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4 will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images -# or other source files which should be copied to the LaTeX output directory. -# Note that the files will be copied as-is; there are no commands or markers -# available. - -LATEX_EXTRA_FILES = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = YES - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = YES - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- - -# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files -# that can be used to generate PDF. - -GENERATE_DOCBOOK = NO - -# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in -# front of it. If left blank docbook will be used as the default path. - -DOCBOOK_OUTPUT = docbook - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = DOXYGEN \ - PRINTF_ATTRIBUTE(x,y)= - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# -# TAGFILES = file1 file2 ... -# 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. Note that 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 run, you must also specify the path to the tagfile here. - -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. - -GENERATE_TAGFILE = @CMAKE_CURRENT_BINARY_DIR@/html/@PROJECT_NAME@.TAGFILE - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = YES - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed -# in the related pages index. If set to NO, only the current project's -# pages will be listed. - -EXTERNAL_PAGES = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -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, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = @DOXYGEN_DOT_FOUND@ - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# manageable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = @DOXYGEN_DOT_EXECUTABLE_PATH@ - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/third_party/cmocka/doc/mainpage.dox b/third_party/cmocka/doc/mainpage.dox index 925bfd2..4c26d96 100644 --- a/third_party/cmocka/doc/mainpage.dox +++ b/third_party/cmocka/doc/mainpage.dox @@ -124,7 +124,10 @@ The case doesn't matter. The XML output goes to stderr by default. If the environment variable CMOCKA_XML_FILE exists and the file specified by this variable -doesn't exist yet, then cmocka will put the output to this file. - +doesn't exist yet, then cmocka will put the output to this file. Note +that if you are have several groups you should set CMOCKA_XML_FILE +to CMOCKA_XML_FILE=cm_%%g.xml. In this %g will be replaced by +the group_name of the test and a file will be created for each group, +othwerwise all groups will be printed into the same file. */ diff --git a/third_party/cmocka/example/CMakeLists.txt b/third_party/cmocka/example/CMakeLists.txt index e46a4fc..4951733 100644 --- a/third_party/cmocka/example/CMakeLists.txt +++ b/third_party/cmocka/example/CMakeLists.txt @@ -13,7 +13,10 @@ set_source_files_properties( PROPERTIES COMPILE_DEFINITIONS UNIT_TESTING=1) -if (WIN32) + +if (WIN32 OR CYGWIN OR MINGW) + set(CMOCKA_DLL_LIB ${CMAKE_BINARY_DIR}/src) + file(TO_NATIVE_PATH "${CMOCKA_DLL_PATH}" CMOCKA_DLL_PATH) set(DLL_PATH_ENV "${CMOCKA_DLL_PATH};$ENV{PATH}") # @@ -22,7 +25,7 @@ if (WIN32) # because of this we must protect the semicolons in the path # string(REPLACE ";" "\\;" DLL_PATH_ENV "${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) ### The most simple test @@ -30,29 +33,40 @@ add_executable(simple_test simple_test.c) target_link_libraries(simple_test ${CMOCKA_SHARED_LIBRARY}) add_test(simple_test ${CMAKE_CURRENT_BINARY_DIR}/simple_test) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(simple_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) ### Calulator test -if (NOT WIN32) +#TODO investigate dll jmp issue on MinGW +if (NOT MINGW OR WITH_STATIC_LIB) add_executable(calculator_test calculator.c calculator_test.c) - target_link_libraries(calculator_test ${CMOCKA_SHARED_LIBRARY}) - add_test(calculator_test ${CMAKE_CURRENT_BINARY_DIR}/calculator_test) -endif (NOT WIN32) + if (WIN32 OR CYGWIN) + set_tests_properties(calculator_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") + endif (WIN32 OR CYGWIN) + + if (MINGW) + target_link_libraries(calculator_test ${CMOCKA_STATIC_LIBRARY}) + else (MINGW) + target_link_libraries(calculator_test ${CMOCKA_SHARED_LIBRARY}) + endif (MINGW) + + if (WIN32 OR CYGWIN OR MINGW) + set_tests_properties(calculator_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") + endif (WIN32 OR CYGWIN OR MINGW) +endif (NOT MINGW OR WITH_STATIC_LIB) -# FIXME These tests fail on Windows when run with ctest but look correct excuted manually. -if (NOT WIN32) ### Allocate module test add_executable(allocate_module_test allocate_module.c allocate_module_test.c) target_link_libraries(allocate_module_test ${CMOCKA_SHARED_LIBRARY}) # This is a test that should detect leaks and overflows and will fail for that add_test(allocate_module_test ${CMAKE_CURRENT_BINARY_DIR}/allocate_module_test) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(allocate_module_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) + set_tests_properties( allocate_module_test PROPERTIES @@ -69,9 +83,9 @@ set_tests_properties( PROPERTIES WILL_FAIL 1 ) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(assert_macro_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) ### Assert module test add_executable(assert_module_test assert_module.c assert_module_test.c) @@ -83,28 +97,27 @@ set_tests_properties( PROPERTIES WILL_FAIL 1 ) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(assert_module_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) -endif (NOT WIN32) # FIXME FAIL +endif (WIN32 OR CYGWIN OR MINGW) ### Customer database test add_executable(customer_database_test customer_database.c customer_database_test.c) target_link_libraries(customer_database_test ${CMOCKA_SHARED_LIBRARY}) add_test(customer_database_test ${CMAKE_CURRENT_BINARY_DIR}/customer_database_test) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(customer_database_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) ### Key Value Test add_executable(key_value_test key_value.c key_value_test.c) target_link_libraries(key_value_test ${CMOCKA_SHARED_LIBRARY}) add_test(key_value_test ${CMAKE_CURRENT_BINARY_DIR}/key_value_test) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(key_value_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) ### Product database test add_executable(product_database_test product_database.c product_database_test.c) @@ -117,9 +130,9 @@ set_tests_properties( PASS_REGULAR_EXPRESSION "\\[ FAILED \\] 2 test" ) -if (WIN32) +if (WIN32 OR CYGWIN OR MINGW) set_tests_properties(product_database_test PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR CYGWIN OR MINGW) # TODO Execute "$CMAKE_LINKER --help" and check for --wrap if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)" AND NOT APPLE) diff --git a/third_party/cmocka/example/allocate_module_test.c b/third_party/cmocka/example/allocate_module_test.c index cd5d371..562aea2 100644 --- a/third_party/cmocka/example/allocate_module_test.c +++ b/third_party/cmocka/example/allocate_module_test.c @@ -18,9 +18,9 @@ #include #include -extern void leak_memory(); -extern void buffer_overflow(); -extern void buffer_underflow(); +extern void leak_memory(void); +extern void buffer_overflow(void); +extern void buffer_underflow(void); /* Test case that fails as leak_memory() leaks a dynamically allocated block. */ static void leak_memory_test(void **state) { diff --git a/third_party/cmocka/example/chef_wrap/CMakeLists.txt b/third_party/cmocka/example/chef_wrap/CMakeLists.txt index 5902438..68afec0 100644 --- a/third_party/cmocka/example/chef_wrap/CMakeLists.txt +++ b/third_party/cmocka/example/chef_wrap/CMakeLists.txt @@ -15,6 +15,6 @@ set_target_properties(waiter_test_wrap PROPERTIES LINK_FLAGS "-Wl,--wrap=chef_cook" ) -if (WIN32) +if (WIN32 OR MINGW OR CYGWIN) set_tests_properties(waiter_test_wrap PROPERTIES ENVIRONMENT "PATH=${DLL_PATH_ENV}") -endif (WIN32) +endif (WIN32 OR MINGW OR CYGWIN) diff --git a/third_party/cmocka/example/customer_database_test.c b/third_party/cmocka/example/customer_database_test.c index 2f78b05..45ec782 100644 --- a/third_party/cmocka/example/customer_database_test.c +++ b/third_party/cmocka/example/customer_database_test.c @@ -19,7 +19,7 @@ #include #include -extern DatabaseConnection* connect_to_customer_database(); +extern DatabaseConnection* connect_to_customer_database(void); extern unsigned int get_customer_id_by_name( DatabaseConnection * const connection, const char * const customer_name); diff --git a/third_party/cmocka/example/fixture_test.c b/third_party/cmocka/example/fixture_test.c deleted file mode 100644 index 757394a..0000000 --- a/third_party/cmocka/example/fixture_test.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include - -#include - -static void setup_only(void **state) -{ - *state = malloc(1); -} - -static void teardown_only(void **state) -{ - free(*state); -} - -static void malloc_setup_test(void **state) -{ - assert_non_null(*state); - free(*state); -} - -static void malloc_teardown_test(void **state) -{ - *state = malloc(1); - assert_non_null(*state); -} - -int main(void) { - const UnitTest tests[] = { - unit_test_setup(malloc_setup_test, setup_only), - unit_test_teardown(malloc_teardown_test, teardown_only), - }; - - return run_tests(tests); -} diff --git a/third_party/cmocka/include/cmocka.h b/third_party/cmocka/include/cmocka.h index 797fbe2..72d6ae2 100644 --- a/third_party/cmocka/include/cmocka.h +++ b/third_party/cmocka/include/cmocka.h @@ -71,7 +71,7 @@ int __stdcall IsDebuggerPresent(); typedef uintmax_t LargestIntegralType; #else /* DOXGEN */ #ifndef LargestIntegralType -# if __WORDSIZE == 64 +# if __WORDSIZE == 64 && !defined(_WIN64) # define LargestIntegralType unsigned long int # else # define LargestIntegralType unsigned long long int @@ -79,7 +79,7 @@ typedef uintmax_t LargestIntegralType; #endif /* LargestIntegralType */ #endif /* DOXYGEN */ -/* Printf format used to display LargestIntegralType. */ +/* Printf format used to display LargestIntegralType as a hexidecimal. */ #ifndef LargestIntegralTypePrintfFormat # ifdef _WIN32 # define LargestIntegralTypePrintfFormat "0x%I64x" @@ -92,6 +92,19 @@ typedef uintmax_t LargestIntegralType; # endif /* _WIN32 */ #endif /* LargestIntegralTypePrintfFormat */ +/* Printf format used to display LargestIntegralType as a decimal. */ +#ifndef LargestIntegralTypePrintfFormatDecimal +# ifdef _WIN32 +# define LargestIntegralTypePrintfFormatDecimal "%I64u" +# else +# if __WORDSIZE == 64 +# define LargestIntegralTypePrintfFormatDecimal "%lu" +# else +# define LargestIntegralTypePrintfFormatDecimal "%llu" +# endif +# endif /* _WIN32 */ +#endif /* LargestIntegralTypePrintfFormat */ + /* Perform an unsigned cast to LargestIntegralType. */ #define cast_to_largest_integral_type(value) \ ((LargestIntegralType)(value)) @@ -149,6 +162,9 @@ cast_to_largest_integral_type(cast_to_pointer_integral_type(value)) #define CMOCKA_DEPRECATED #endif +#define WILL_RETURN_ALWAYS -1 +#define WILL_RETURN_ONCE -2 + /** * @defgroup cmocka_mock Mock Objects * @ingroup cmocka @@ -304,9 +320,11 @@ void will_return(#function, LargestIntegralType value); * * @param[in] value The value to be returned by mock(). * - * @param[in] count The parameter returns the number of times the value should - * be returned by mock(). If count is set to -1 the value will - * always be returned. + * @param[in] count The parameter indicates the number of times the value should + * be returned by mock(). If count is set to -1, the value + * will always be returned but must be returned at least once. + * If count is set to -2, the value will always be returned + * by mock(), but is not required to be returned. * * @see mock() */ @@ -336,9 +354,36 @@ void will_return_count(#function, LargestIntegralType value, int count); void will_return_always(#function, LargestIntegralType value); #else #define will_return_always(function, value) \ - will_return_count(function, (value), -1) + will_return_count(function, (value), WILL_RETURN_ALWAYS) #endif +#ifdef DOXYGEN +/** + * @brief Store a value that may be always returned by mock(). + * + * This stores a value which will always be returned by mock() but is not + * required to be returned by at least one call to mock(). Therefore, + * in contrast to will_return_always() which causes a test failure if it + * is not returned at least once, will_return_maybe() will never cause a test + * to fail if its value is not returned. + * + * @param[in] #function The function which should return the given value. + * + * @param[in] #value The value to be returned by mock(). + * + * This is equivalent to: + * @code + * will_return_count(function, value, -2); + * @endcode + * + * @see will_return_count() + * @see mock() + */ +void will_return_maybe(#function, LargestIntegralType value); +#else +#define will_return_maybe(function, value) \ + will_return_count(function, (value), WILL_RETURN_ONCE) +#endif /** @} */ /** @@ -1335,6 +1380,138 @@ void assert_not_in_set(LargestIntegralType value, LargestIntegralType values[], /** @} */ +/** + * @defgroup cmocka_call_order Call Ordering + * @ingroup cmocka + * + * It is often beneficial to make sure that functions are called in an + * order. This is independent of mock returns and parameter checking as both + * of the aforementioned do not check the order in which they are called from + * different functions. + * + *
    + *
  • expect_function_call(function) - The + * expect_function_call() macro pushes an expectation onto the stack of + * expected calls.
  • + * + *
  • function_called() - pops a value from the stack of + * expected calls. function_called() is invoked within the mock object + * that uses it. + *
+ * + * expect_function_call() and function_called() are intended to be used in + * pairs. Cmocka will fail a test if there are more or less expected calls + * created (e.g. expect_function_call()) than consumed with function_called(). + * There are provisions such as ignore_function_calls() which allow this + * restriction to be circumvented in tests where mock calls for the code under + * test are not the focus of the test. + * + * The following example illustrates how a unit test instructs cmocka + * to expect a function_called() from a particular mock, + * chef_sing(): + * + * @code + * void chef_sing(void); + * + * void code_under_test() + * { + * chef_sing(); + * } + * + * void some_test(void **state) + * { + * expect_function_call(chef_sing); + * code_under_test(); + * } + * @endcode + * + * The implementation of the mock then must check whether it was meant to + * be called by invoking function_called(): + * + * @code + * void chef_sing() + * { + * function_called(); + * } + * @endcode + * + * @{ + */ + +#ifdef DOXYGEN +/** + * @brief Check that current mocked function is being called in the expected + * order + * + * @see expect_function_call() + */ +void function_called(void); +#else +#define function_called() _function_called(__func__, __FILE__, __LINE__) +#endif + +#ifdef DOXYGEN +/** + * @brief Store expected call(s) to a mock to be checked by function_called() + * later. + * + * @param[in] #function The function which should should be called + * + * @param[in] times number of times this mock must be called + * + * @see function_called() + */ +void expect_function_calls(#function, const int times); +#else +#define expect_function_calls(function, times) \ + _expect_function_call(#function, __FILE__, __LINE__, times) +#endif + +#ifdef DOXYGEN +/** + * @brief Store expected single call to a mock to be checked by + * function_called() later. + * + * @param[in] #function The function which should should be called + * + * @see function_called() + */ +void expect_function_call(#function); +#else +#define expect_function_call(function) \ + _expect_function_call(#function, __FILE__, __LINE__, 1) +#endif + +#ifdef DOXYGEN +/** + * @brief Expects function_called() from given mock at least once + * + * @param[in] #function The function which should should be called + * + * @see function_called() + */ +void expect_function_call_any(#function); +#else +#define expect_function_call_any(function) \ + _expect_function_call(#function, __FILE__, __LINE__, -1) +#endif + +#ifdef DOXYGEN +/** + * @brief Ignores function_called() invocations from given mock function. + * + * @param[in] #function The function which should should be called + * + * @see function_called() + */ +void ignore_function_calls(#function); +#else +#define ignore_function_calls(function) \ + _expect_function_call(#function, __FILE__, __LINE__, -2) +#endif + +/** @} */ + /** * @defgroup cmocka_exec Running Tests * @ingroup cmocka @@ -1489,19 +1666,37 @@ static inline void _unit_test_dummy(void **state) { /** Initializes a CMUnitTest structure. */ -#define cmocka_unit_test(f) { #f, f, NULL, NULL } +#define cmocka_unit_test(f) { #f, f, NULL, NULL, NULL } /** Initializes a CMUnitTest structure with a setup function. */ -#define cmocka_unit_test_setup(f, setup) { #f, f, setup, NULL } +#define cmocka_unit_test_setup(f, setup) { #f, f, setup, NULL, NULL } /** Initializes a CMUnitTest structure with a teardown function. */ -#define cmocka_unit_test_teardown(f, teardown) { #f, f, NULL, teardown } +#define cmocka_unit_test_teardown(f, teardown) { #f, f, NULL, teardown, NULL } /** * Initialize an array of CMUnitTest structures with a setup function for a test * and a teardown function. Either setup or teardown can be NULL. */ -#define cmocka_unit_test_setup_teardown(f, setup, teardown) { #f, f, setup, teardown } +#define cmocka_unit_test_setup_teardown(f, setup, teardown) { #f, f, setup, teardown, NULL } + +/** + * Initialize a CMUnitTest structure with given initial state. It will be passed + * to test function as an argument later. It can be used when test state does + * not need special initialization or was initialized already. + * @note If the group setup function initialized the state already, it won't be + * overridden by the initial state defined here. + */ +#define cmocka_unit_test_prestate(f, state) { #f, f, NULL, NULL, state } + +/** + * Initialize a CMUnitTest structure with given initial state, setup and + * teardown function. Any of these values can be NULL. Initial state is passed + * later to setup function, or directly to test if none was given. + * @note If the group setup function initialized the state already, it won't be + * overridden by the initial state defined here. + */ +#define cmocka_unit_test_prestate_setup_teardown(f, setup, teardown, state) { #f, f, setup, teardown, state } #define run_tests(tests) _run_tests(tests, sizeof(tests) / sizeof(tests)[0]) #define run_group_tests(tests) _run_group_tests(tests, sizeof(tests) / sizeof(tests)[0]) @@ -1894,6 +2089,7 @@ struct CMUnitTest { CMUnitTestFunction test_func; CMFixtureFunction setup_func; CMFixtureFunction teardown_func; + void *initial_state; }; /* Location within some source code. */ @@ -1919,6 +2115,15 @@ extern const char * global_last_failed_assert; LargestIntegralType _mock(const char * const function, const char* const file, const int line); +void _expect_function_call( + const char * const function_name, + const char * const file, + const int line, + const int count); + +void _function_called(const char * const function, const char* const file, + const int line); + void _expect_check( const char* const function, const char* const parameter, const char* const file, const int line, diff --git a/third_party/cmocka/src/cmocka.c b/third_party/cmocka/src/cmocka.c index 2a63f82..69a8e82 100644 --- a/third_party/cmocka/src/cmocka.c +++ b/third_party/cmocka/src/cmocka.c @@ -82,12 +82,30 @@ # define CMOCKA_THREAD #endif -#ifdef HAVE_CLOCK_GETTIME_REALTIME +#ifdef HAVE_CLOCK_REALTIME #define CMOCKA_CLOCK_GETTIME(clock_id, ts) clock_gettime((clock_id), (ts)) #else #define CMOCKA_CLOCK_GETTIME(clock_id, ts) #endif +#ifndef MAX +#define MAX(a,b) ((a) < (b) ? (b) : (a)) +#endif + +/** + * POSIX has sigsetjmp/siglongjmp, while Windows only has setjmp/longjmp. + */ +#ifdef HAVE_SIGLONGJMP +# define cm_jmp_buf sigjmp_buf +# define cm_setjmp(env) sigsetjmp(env, 1) +# define cm_longjmp(env, val) siglongjmp(env, val) +#else +# define cm_jmp_buf jmp_buf +# define cm_setjmp(env) setjmp(env) +# define cm_longjmp(env, val) longjmp(env, val) +#endif + + /* * Declare and initialize the pointer member of ValuePointer variable name * with ptr. @@ -164,6 +182,12 @@ typedef struct SymbolMapValue { ListNode symbol_values_list_head; } SymbolMapValue; +/* Where a particular ordering was located and its symbol name */ +typedef struct FuncOrderingValue { + SourceLocation location; + const char * function; +} FuncOrderingValue; + /* Used by list_free() to deallocate values referenced by list nodes. */ typedef void (*CleanupListValue)(const void *value, void *cleanup_value_data); @@ -219,9 +243,16 @@ static void free_symbol_map_value( const void *value, void *cleanup_value_data); static void remove_always_return_values(ListNode * const map_head, const size_t number_of_symbol_names); + +static int check_for_leftover_values_list(const ListNode * head, + const char * const error_message); + static int check_for_leftover_values( const ListNode * const map_head, const char * const error_message, const size_t number_of_symbol_names); + +static void remove_always_return_values_from_list(ListNode * const map_head); + /* * This must be called at the beginning of a test to initialize some data * structures. @@ -231,6 +262,8 @@ static void initialize_testing(const char *test_name); /* This must be called at the end of a test to free() allocated structures. */ static void teardown_testing(const char *test_name); +static enum cm_message_output cm_get_output(void); + static int cm_error_message_enabled = 1; static CMOCKA_THREAD char *cm_error_message; @@ -240,7 +273,7 @@ void cm_print_error(const char * const format, ...) CMOCKA_PRINTF_ATTRIBUTE(1, 2 * Keeps track of the calling context returned by setenv() so that the fail() * method can jump out of a test. */ -static CMOCKA_THREAD jmp_buf global_run_test_env; +static CMOCKA_THREAD cm_jmp_buf global_run_test_env; static CMOCKA_THREAD int global_running_test = 0; /* Keeps track of the calling context returned by setenv() so that */ @@ -262,6 +295,11 @@ static CMOCKA_THREAD ListNode global_function_parameter_map_head; /* Location of last parameter value checked was declared. */ static CMOCKA_THREAD SourceLocation global_last_parameter_location; +/* List (acting as FIFO) of call ordering. */ +static CMOCKA_THREAD ListNode global_call_ordering_head; +/* Location of last call ordering that was declared. */ +static CMOCKA_THREAD SourceLocation global_last_call_ordering_location; + /* List of all currently allocated blocks. */ static CMOCKA_THREAD ListNode global_allocated_blocks; @@ -349,7 +387,7 @@ static void exit_test(const int quit_application) print_error("%s", cm_error_message); abort(); } else if (global_running_test) { - longjmp(global_run_test_env, 1); + cm_longjmp(global_run_test_env, 1); } else if (quit_application) { exit(-1); } @@ -387,19 +425,60 @@ static void set_source_location( } +static int c_strreplace(char *src, + size_t src_len, + const char *pattern, + const char *repl, + int *str_replaced) +{ + char *p = NULL; + + p = strstr(src, pattern); + if (p == NULL) { + return -1; + } + + do { + size_t of = p - src; + size_t l = strlen(src); + size_t pl = strlen(pattern); + size_t rl = strlen(repl); + + /* overflow check */ + if (src_len <= l + MAX(pl, rl) + 1) { + return -1; + } + + if (rl != pl) { + memmove(src + of + rl, src + of + pl, l - of - pl + 1); + } + + strncpy(src + of, repl, rl); + + if (str_replaced != NULL) { + *str_replaced = 1; + } + p = strstr(src, pattern); + } while (p != NULL); + + return 0; +} + /* Create function results and expected parameter lists. */ void initialize_testing(const char *test_name) { - (void)test_name; + (void)test_name; list_initialize(&global_function_result_map_head); initialize_source_location(&global_last_mock_value_location); list_initialize(&global_function_parameter_map_head); initialize_source_location(&global_last_parameter_location); + list_initialize(&global_call_ordering_head); + initialize_source_location(&global_last_parameter_location); } static void fail_if_leftover_values(const char *test_name) { int error_occurred = 0; - (void)test_name; + (void)test_name; remove_always_return_values(&global_function_result_map_head, 1); if (check_for_leftover_values( &global_function_result_map_head, @@ -413,6 +492,12 @@ static void fail_if_leftover_values(const char *test_name) { "%s parameter still has values that haven't been checked.\n", 2)) { error_occurred = 1; } + + remove_always_return_values_from_list(&global_call_ordering_head); + if (check_for_leftover_values_list(&global_call_ordering_head, + "%s function was expected to be called but was not not.\n")) { + error_occurred = 1; + } if (error_occurred) { exit_test(1); } @@ -420,13 +505,16 @@ static void fail_if_leftover_values(const char *test_name) { static void teardown_testing(const char *test_name) { - (void)test_name; + (void)test_name; list_free(&global_function_result_map_head, free_symbol_map_value, (void*)0); initialize_source_location(&global_last_mock_value_location); list_free(&global_function_parameter_map_head, free_symbol_map_value, (void*)1); initialize_source_location(&global_last_parameter_location); + list_free(&global_call_ordering_head, free_value, + (void*)0); + initialize_source_location(&global_last_call_ordering_location); } /* Initialize a list node. */ @@ -545,7 +633,7 @@ static int list_first(ListNode * const head, ListNode **output) { /* Deallocate a value referenced by a list. */ static void free_value(const void *value, void *cleanup_value_data) { - (void)cleanup_value_data; + (void)cleanup_value_data; assert_non_null(value); free((void*)value); } @@ -573,7 +661,6 @@ static int symbol_names_match(const void *map_value, const void *symbol) { (const char*)symbol); } - /* * Adds a value to the queue of values associated with the given hierarchy of * symbols. It's assumed value is allocated from the heap. @@ -645,8 +732,10 @@ static int get_symbol_value( assert_true(return_value); *output = (void*) value_node->value; return_value = value_node->refcount; - if (--value_node->refcount == 0) { + if (value_node->refcount - 1 == 0) { list_remove_free(value_node, NULL, NULL); + } else if (value_node->refcount > WILL_RETURN_ONCE) { + --value_node->refcount; } } else { return_value = get_symbol_value( @@ -663,6 +752,26 @@ static int get_symbol_value( return 0; } +/** + * Taverse a list of nodes and remove first symbol value in list that has a + * refcount < -1 (i.e. should always be returned and has been returned at + * least once). + */ + +static void remove_always_return_values_from_list(ListNode * const map_head) +{ + ListNode * current = NULL; + ListNode * next = NULL; + assert_non_null(map_head); + + for (current = map_head->next, next = current->next; + current != map_head; + current = next, next = current->next) { + if (current->refcount < -1) { + list_remove_free(current, free_value, NULL); + } + } +} /* * Traverse down a tree of symbol values and remove the first symbol value @@ -702,6 +811,26 @@ static void remove_always_return_values(ListNode * const map_head, } } +static int check_for_leftover_values_list(const ListNode * head, + const char * const error_message) +{ + ListNode *child_node; + int leftover_count = 0; + if (!list_empty(head)) + { + for (child_node = head->next; child_node != head; + child_node = child_node->next, ++leftover_count) { + const FuncOrderingValue *const o = + (const FuncOrderingValue*) child_node->value; + cm_print_error(error_message, o->function); + cm_print_error(SOURCE_LOCATION_FORMAT + ": note: remaining item was declared here\n", + o->location.file, o->location.line); + } + } + return leftover_count; +} + /* * Checks if there are any leftover values set up by the test that were never * retrieved through execution, and fail the test if that is the case. @@ -778,14 +907,89 @@ LargestIntegralType _mock(const char * const function, const char* const file, return 0; } +/* Ensure that function is being called in proper order */ +void _function_called(const char *const function, + const char *const file, + const int line) +{ + ListNode *first_value_node = NULL; + ListNode *value_node = NULL; + int rc; + + rc = list_first(&global_call_ordering_head, &value_node); + first_value_node = value_node; + if (rc) { + FuncOrderingValue *expected_call; + int cmp; + + expected_call = (FuncOrderingValue *)value_node->value; + + cmp = strcmp(expected_call->function, function); + if (value_node->refcount < -1) { + /* + * Search through value nodes until either function is found or + * encounter a non-zero refcount greater than -2 + */ + if (cmp != 0) { + value_node = value_node->next; + expected_call = (FuncOrderingValue *)value_node->value; + + cmp = strcmp(expected_call->function, function); + while (value_node->refcount < -1 && + cmp != 0 && + value_node != first_value_node->prev) { + value_node = value_node->next; + if (value_node == NULL) { + break; + } + expected_call = (FuncOrderingValue *)value_node->value; + if (expected_call == NULL) { + continue; + } + cmp = strcmp(expected_call->function, function); + } + + if (expected_call == NULL || value_node == first_value_node->prev) { + cm_print_error(SOURCE_LOCATION_FORMAT + ": error: No expected mock calls matching " + "called() invocation in %s", + file, line, + function); + exit_test(1); + } + } + } + + if (cmp == 0) { + if (value_node->refcount > -2 && --value_node->refcount == 0) { + list_remove_free(value_node, free_value, NULL); + } + } else { + cm_print_error(SOURCE_LOCATION_FORMAT + ": error: Expected call to %s but received called() " + "in %s\n", + file, line, + expected_call->function, + function); + exit_test(1); + } + } else { + cm_print_error(SOURCE_LOCATION_FORMAT + ": error: No mock calls expected but called() was " + "invoked in %s\n", + file, line, + function); + exit_test(1); + } +} /* Add a return value for the specified mock function name. */ void _will_return(const char * const function_name, const char * const file, const int line, const LargestIntegralType value, const int count) { SymbolValue * const return_value = - (SymbolValue*)malloc(sizeof(*return_value)); - assert_true(count > 0 || count == -1); + (SymbolValue*)malloc(sizeof(*return_value)); + assert_true(count != 0); return_value->value = value; set_source_location(&return_value->location, file, line); add_symbol_value(&global_function_result_map_head, &function_name, 1, @@ -816,6 +1020,31 @@ void _expect_check( count); } +/* + * Add an call expectations that a particular function is called correctly. + * This is used for code under test that makes calls to several functions + * in depended upon components (mocks). + */ + +void _expect_function_call( + const char * const function_name, + const char * const file, + const int line, + const int count) +{ + FuncOrderingValue *ordering; + + assert_non_null(function_name); + assert_non_null(file); + assert_true(count != 0); + + ordering = (FuncOrderingValue *)malloc(sizeof(*ordering)); + + set_source_location(&ordering->location, file, line); + ordering->function = function_name; + + list_add_value(&global_call_ordering_head, ordering, count); +} /* Returns 1 if the specified values are equal. If the values are not equal * an error is displayed and 0 is returned. */ @@ -870,10 +1099,11 @@ static int value_in_set_display_error( if (succeeded) { return 1; } - cm_print_error("%" PRIu64 " is %sin the set (", value, - invert ? "" : "not "); + cm_print_error(LargestIntegralTypePrintfFormatDecimal + " is %sin the set (", + value, invert ? "" : "not "); for (i = 0; i < size_of_set; i++) { - cm_print_error("%" PRIu64 ", ", set[i]); + cm_print_error(LargestIntegralTypePrintfFormat ", ", set[i]); } cm_print_error(")\n"); } @@ -892,7 +1122,10 @@ static int integer_in_range_display_error( if (value >= range_min && value <= range_max) { return 1; } - cm_print_error("%" PRIu64 " is not within the range %" PRIu64 "-%" PRIu64 "\n", + cm_print_error(LargestIntegralTypePrintfFormatDecimal + " is not within the range " + LargestIntegralTypePrintfFormatDecimal "-" + LargestIntegralTypePrintfFormatDecimal "\n", value, range_min, range_max); return 0; } @@ -909,7 +1142,10 @@ static int integer_not_in_range_display_error( if (value < range_min || value > range_max) { return 1; } - cm_print_error("%" PRIu64 " is within the range %" PRIu64 "-%" PRIu64 "\n", + cm_print_error(LargestIntegralTypePrintfFormatDecimal + " is within the range " + LargestIntegralTypePrintfFormatDecimal "-" + LargestIntegralTypePrintfFormatDecimal "\n", value, range_min, range_max); return 0; } @@ -963,8 +1199,8 @@ static int memory_equal_display_error(const char* const a, const char* const b, } } if (differences) { - cm_print_error("%d bytes of %p and %p differ\n", differences, - a, b); + cm_print_error("%d bytes of %p and %p differ\n", + differences, (void *)a, (void *)b); return 0; } return 1; @@ -988,8 +1224,8 @@ static int memory_not_equal_display_error( } } if (same == size) { - cm_print_error("%"PRIdS "bytes of %p and %p the same\n", same, - a, b); + cm_print_error("%"PRIdS "bytes of %p and %p the same\n", + same, (void *)a, (void *)b); return 0; } return 1; @@ -1222,7 +1458,7 @@ static void expect_memory_setup( const void * const memory, const size_t size, const CheckParameterValue check_function, const int count) { CheckMemoryData * const check_data = - (CheckMemoryData*)malloc(sizeof(*check_data) + size); + (CheckMemoryData*)malloc(sizeof(*check_data) + size); void * const mem = (void*)(check_data + 1); declare_initialize_value_pointer_pointer(check_data_pointer, check_data); assert_non_null(memory); @@ -1254,7 +1490,7 @@ static int check_not_memory(const LargestIntegralType value, assert_non_null(check); return memory_not_equal_display_error( cast_largest_integral_type_to_pointer(const char*, value), - (const char*)check->memory, + (const char*)check->memory, check->size); } @@ -1272,8 +1508,8 @@ void _expect_not_memory( /* CheckParameterValue callback that always returns 1. */ static int check_any(const LargestIntegralType value, const LargestIntegralType check_value_data) { - (void)value; - (void)check_value_data; + (void)value; + (void)check_value_data; return 1; } @@ -1387,7 +1623,8 @@ void _assert_return_code(const LargestIntegralType result, if (result > valmax - 1) { if (error > 0) { - cm_print_error("%s < 0, errno(%" PRIu64 "): %s\n", + cm_print_error("%s < 0, errno(" + LargestIntegralTypePrintfFormatDecimal "): %s\n", expression, error, strerror((int)error)); } else { cm_print_error("%s < 0\n", expression); @@ -1493,7 +1730,7 @@ void _assert_not_in_set(const LargestIntegralType value, /* Get the list of allocated blocks. */ -static ListNode* get_allocated_blocks_list() { +static ListNode* get_allocated_blocks_list(void) { /* If it initialized, initialize the list of allocated blocks. */ if (!global_allocated_blocks.value) { list_initialize(&global_allocated_blocks); @@ -1535,11 +1772,12 @@ static void vcm_print_error(const char* const format, va_list args) size_t msg_len = 0; va_list ap; int len; + va_copy(ap, args); len = vsnprintf(buffer, sizeof(buffer), format, args); if (len < 0) { /* TODO */ - return; + goto end; } if (cm_error_message == NULL) { @@ -1548,7 +1786,7 @@ static void vcm_print_error(const char* const format, va_list args) cm_error_message = libc_malloc(len + 1); if (cm_error_message == NULL) { /* TODO */ - return; + goto end; } } else { /* APPEND MESSAGE */ @@ -1557,7 +1795,7 @@ static void vcm_print_error(const char* const format, va_list args) msg_len = strlen(cm_error_message); tmp = libc_realloc(cm_error_message, msg_len + len + 1); if (tmp == NULL) { - return; + goto end; } cm_error_message = tmp; } @@ -1566,10 +1804,11 @@ static void vcm_print_error(const char* const format, va_list args) /* Use len + 1 to also copy '\0' */ memcpy(cm_error_message + msg_len, buffer, len + 1); } else { - va_copy(ap, args); vsnprintf(cm_error_message + msg_len, len, format, ap); - va_end(ap); } +end: + va_end(ap); + } static void vcm_free_error(char *err_msg) @@ -1650,7 +1889,7 @@ void _test_free(void* const ptr, const char* file, const int line) { file, line, ptr, (unsigned long)block_info->size, block_info->location.file, block_info->location.line, - &guard[j]); + (void *)&guard[j]); _fail(file, line); } } @@ -1673,7 +1912,7 @@ void *_test_realloc(void *ptr, MallocBlockInfo *block_info; char *block = ptr; size_t block_size = size; - void *new; + void *new_block; if (ptr == NULL) { return _test_malloc(size, file, line); @@ -1687,8 +1926,8 @@ void *_test_realloc(void *ptr, block_info = (MallocBlockInfo*)(block - (MALLOC_GUARD_SIZE + sizeof(*block_info))); - new = _test_malloc(size, file, line); - if (new == NULL) { + new_block = _test_malloc(size, file, line); + if (new_block == NULL) { return NULL; } @@ -1696,17 +1935,17 @@ void *_test_realloc(void *ptr, block_size = block_info->size; } - memcpy(new, ptr, block_size); + memcpy(new_block, ptr, block_size); /* Free previous memory */ _test_free(ptr, file, line); - return new; + return new_block; } #define realloc test_realloc /* Crudely checkpoint the current heap state. */ -static const ListNode* check_point_allocated_blocks() { +static const ListNode* check_point_allocated_blocks(void) { return get_allocated_blocks_list()->prev; } @@ -1722,7 +1961,7 @@ static int display_allocated_blocks(const ListNode * const check_point) { for (node = check_point->next; node != head; node = node->next) { const MallocBlockInfo * const block_info = - (const MallocBlockInfo*)node->value; + (const MallocBlockInfo*)node->value; assert_non_null(block_info); if (!allocated_blocks) { @@ -1769,18 +2008,30 @@ static void fail_if_blocks_allocated(const ListNode * const check_point, void _fail(const char * const file, const int line) { - cm_print_error(SOURCE_LOCATION_FORMAT ": error: Failure!\n", file, line); + enum cm_message_output output = cm_get_output(); + + switch(output) { + case CM_OUTPUT_STDOUT: + cm_print_error("[ LINE ] --- " SOURCE_LOCATION_FORMAT ": error: Failure!", file, line); + break; + default: + cm_print_error(SOURCE_LOCATION_FORMAT ": error: Failure!", file, line); + break; + } exit_test(1); } #ifndef _WIN32 static void exception_handler(int sig) { + const char *sig_strerror = ""; + #ifdef HAVE_STRSIGNAL - cm_print_error("Test failed with exception: %s\n", strsignal(sig)); -#else - cm_print_error("Test failed with exception: %d\n", sig); + sig_strerror = strsignal(sig); #endif + + cm_print_error("Test failed with exception: %s(%d)", + sig_strerror, sig); exit_test(1); } @@ -1901,6 +2152,9 @@ enum cm_printf_type { PRINTF_TEST_SKIPPED, }; +static int xml_printed; +static int file_append; + static void cmprintf_group_finish_xml(const char *group_name, size_t total_executed, size_t total_failed, @@ -1911,34 +2165,59 @@ static void cmprintf_group_finish_xml(const char *group_name, { FILE *fp = stdout; int file_opened = 0; + int multiple_files = 0; char *env; size_t i; env = getenv("CMOCKA_XML_FILE"); if (env != NULL) { char buf[1024]; + int rc; + snprintf(buf, sizeof(buf), "%s", env); + rc = c_strreplace(buf, sizeof(buf), "%g", group_name, &multiple_files); + if (rc < 0) { + snprintf(buf, sizeof(buf), "%s", env); + } + fp = fopen(buf, "r"); if (fp == NULL) { fp = fopen(buf, "w"); if (fp != NULL) { + file_append = 1; file_opened = 1; } else { fp = stderr; } } else { fclose(fp); - fp = stderr; + if (file_append) { + fp = fopen(buf, "a"); + if (fp != NULL) { + file_opened = 1; + xml_printed = 1; + } else { + fp = stderr; + } + } else { + fp = stderr; + } + } + } + + if (!xml_printed || (file_opened && !file_append)) { + fprintf(fp, "\n"); + if (!file_opened) { + xml_printed = 1; } } - fprintf(fp, "\n"); fprintf(fp, "\n"); fprintf(fp, " \n", group_name, - total_runtime * 1000, /* miliseconds */ + total_runtime, /* seconds */ (unsigned)total_executed, (unsigned)total_failed, (unsigned)total_errors, @@ -1948,7 +2227,7 @@ static void cmprintf_group_finish_xml(const char *group_name, struct CMUnitTestState *cmtest = &cm_tests[i]; fprintf(fp, " \n", - cmtest->test->name, cmtest->runtime * 1000); + cmtest->test->name, cmtest->runtime); switch (cmtest->status) { case CM_TEST_ERROR: @@ -2038,7 +2317,7 @@ static void cmprintf_standard(enum cm_printf_type type, break; case PRINTF_TEST_FAILURE: if (error_message != NULL) { - print_error("%s\n", error_message); + print_error("[ ERROR ] --- %s\n", error_message); } print_message("[ FAILED ] %s\n", test_name); break; @@ -2056,7 +2335,7 @@ static void cmprintf_standard(enum cm_printf_type type, static void cmprintf_group_start_tap(const size_t num_tests) { - print_message("\t1..%u\n", (unsigned)num_tests); + print_message("1..%u\n", (unsigned)num_tests); } static void cmprintf_group_finish_tap(const char *group_name, @@ -2068,7 +2347,7 @@ static void cmprintf_group_finish_tap(const char *group_name, if (total_passed + total_skipped == total_executed) { status = "ok"; } - print_message("%s - %s\n", status, group_name); + print_message("# %s - %s\n", status, group_name); } static void cmprintf_tap(enum cm_printf_type type, @@ -2080,10 +2359,10 @@ static void cmprintf_tap(enum cm_printf_type type, case PRINTF_TEST_START: break; case PRINTF_TEST_SUCCESS: - print_message("\tok %u - %s\n", (unsigned)test_number, test_name); + print_message("ok %u - %s\n", (unsigned)test_number, test_name); break; case PRINTF_TEST_FAILURE: - print_message("\tnot ok %u - %s\n", (unsigned)test_number, test_name); + print_message("not ok %u - %s\n", (unsigned)test_number, test_name); if (error_message != NULL) { char *msg; char *p; @@ -2102,7 +2381,7 @@ static void cmprintf_tap(enum cm_printf_type type, p[0] = '\0'; } - print_message("\t# %s\n", q); + print_message("# %s\n", q); if (p == NULL) { break; @@ -2113,10 +2392,10 @@ static void cmprintf_tap(enum cm_printf_type type, } break; case PRINTF_TEST_SKIPPED: - print_message("\tnot ok %u # SKIP %s\n", (unsigned)test_number, test_name); + print_message("not ok %u # SKIP %s\n", (unsigned)test_number, test_name); break; case PRINTF_TEST_ERROR: - print_message("\tnot ok %u - %s %s\n", + print_message("not ok %u - %s %s\n", (unsigned)test_number, test_name, error_message); break; } @@ -2332,7 +2611,7 @@ static int cmocka_run_one_test_or_fixture(const char *function_name, global_running_test = 1; - if (setjmp(global_run_test_env) == 0) { + if (cm_setjmp(global_run_test_env) == 0) { if (test_func != NULL) { test_func(state != NULL ? state : ¤t_state); @@ -2497,6 +2776,7 @@ int _cmocka_run_group_tests(const char *group_name, struct CMUnitTestState *cm_tests; const ListNode *group_check_point = check_point_allocated_blocks(); void *group_state = NULL; + size_t total_tests = 0; size_t total_failed = 0; size_t total_passed = 0; size_t total_executed = 0; @@ -2514,17 +2794,23 @@ int _cmocka_run_group_tests(const char *group_name, return -1; } - cmprintf_group_start(num_tests); - /* Setup cmocka test array */ for (i = 0; i < num_tests; i++) { - cm_tests[i] = (struct CMUnitTestState) { - .test = &tests[i], - .status = CM_TEST_NOT_STARTED, - .state = NULL, - }; + if (tests[i].name != NULL && + (tests[i].test_func != NULL + || tests[i].setup_func != NULL + || tests[i].teardown_func != NULL)) { + cm_tests[i] = (struct CMUnitTestState) { + .test = &tests[i], + .status = CM_TEST_NOT_STARTED, + .state = NULL, + }; + total_tests++; + } } + cmprintf_group_start(total_tests); + rc = 0; /* Run group setup */ @@ -2538,15 +2824,18 @@ int _cmocka_run_group_tests(const char *group_name, if (rc == 0) { /* Execute tests */ - for (i = 0; i < num_tests; i++) { + for (i = 0; i < total_tests; i++) { struct CMUnitTestState *cmtest = &cm_tests[i]; size_t test_number = i + 1; cmprintf(PRINTF_TEST_START, test_number, cmtest->test->name, NULL); if (group_state != NULL) { - cm_tests[i].state = group_state; + cmtest->state = group_state; + } else if (cmtest->test->initial_state != NULL) { + cmtest->state = cmtest->test->initial_state; } + rc = cmocka_run_one_tests(cmtest); total_executed++; total_runtime += cmtest->runtime; @@ -2590,8 +2879,13 @@ int _cmocka_run_group_tests(const char *group_name, } } } else { + if (cm_error_message != NULL) { + print_error("[ ERROR ] --- %s\n", cm_error_message); + vcm_free_error(cm_error_message); + cm_error_message = NULL; + } cmprintf(PRINTF_TEST_ERROR, 0, - group_name, "Group setup failed"); + group_name, "[ FAILED ] GROUP SETUP"); total_errors++; } @@ -2602,6 +2896,15 @@ int _cmocka_run_group_tests(const char *group_name, group_teardown, &group_state, group_check_point); + if (rc != 0) { + if (cm_error_message != NULL) { + print_error("[ ERROR ] --- %s\n", cm_error_message); + vcm_free_error(cm_error_message); + cm_error_message = NULL; + } + cmprintf(PRINTF_TEST_ERROR, 0, + group_name, "[ FAILED ] GROUP TEARDOWN"); + } } cmprintf_group_finish(group_name, @@ -2613,7 +2916,7 @@ int _cmocka_run_group_tests(const char *group_name, total_runtime, cm_tests); - for (i = 0; i < num_tests; i++) { + for (i = 0; i < total_tests; i++) { vcm_free_error(discard_const_p(char, cm_tests[i].error_message)); } libc_free(cm_tests); @@ -2663,7 +2966,7 @@ int _run_test( } initialize_testing(function_name); global_running_test = 1; - if (setjmp(global_run_test_env) == 0) { + if (cm_setjmp(global_run_test_env) == 0) { Function(state ? state : ¤t_state); fail_if_leftover_values(function_name); @@ -2728,7 +3031,7 @@ int _run_tests(const UnitTest * const tests, const size_t number_of_tests) { * when a test setup occurs and popped on tear down. */ TestState* test_states = - (TestState*)malloc(number_of_tests * sizeof(*test_states)); + (TestState*)malloc(number_of_tests * sizeof(*test_states)); /* The number of test states which should be 0 at the end */ long number_of_test_states = 0; /* Names of the tests that failed. */ diff --git a/third_party/cmocka/src/cmocka.def b/third_party/cmocka/src/cmocka.def index 607ad75..43228c4 100644 --- a/third_party/cmocka/src/cmocka.def +++ b/third_party/cmocka/src/cmocka.def @@ -16,6 +16,7 @@ EXPORTS _cmocka_run_group_tests _expect_any _expect_check + _expect_function_call _expect_in_range _expect_in_set _expect_memory @@ -27,6 +28,7 @@ EXPORTS _expect_string _expect_value _fail + _function_called _mock _run_test _run_tests diff --git a/third_party/cmocka/tests/CMakeLists.txt b/third_party/cmocka/tests/CMakeLists.txt index 2f985a5..b1380de 100644 --- a/third_party/cmocka/tests/CMakeLists.txt +++ b/third_party/cmocka/tests/CMakeLists.txt @@ -8,15 +8,21 @@ include_directories( set(CMOCKA_TESTS test_alloc + test_group_setup_assert test_group_setup_fail test_fixtures test_group_fixtures + test_groups test_assert_macros test_assert_macros_fail test_exception_handler test_basics test_skip - test_setup_fail) + test_setup_fail + test_ordering + test_ordering_fail + test_returns + test_returns_fail) foreach(_CMOCKA_TEST ${CMOCKA_TESTS}) add_cmocka_test(${_CMOCKA_TEST} ${_CMOCKA_TEST}.c ${CMOCKA_STATIC_LIBRARY}) @@ -30,7 +36,7 @@ add_cmocka_test(test_cmockery test_cmockery.c ${CMOCKA_STATIC_LIBRARY}) ### Exceptions -# test_assert_macros_fail +# test_skip set_tests_properties( test_skip PROPERTIES @@ -46,6 +52,22 @@ set_tests_properties( "\\[ FAILED \\] 1 test" ) +# test_ordering ensure proper failures +set_tests_properties( + test_ordering_fail + PROPERTIES + PASS_REGULAR_EXPRESSION + "\\[ FAILED \\] 7 test" +) + +# test_returns_fail ensure proper failures +set_tests_properties( + test_returns_fail + PROPERTIES + PASS_REGULAR_EXPRESSION + "\\[ FAILED \\] 3 test" +) + # test_exception_handler if (WIN32) set_tests_properties( @@ -69,6 +91,13 @@ set_tests_properties( 1 ) +set_tests_properties( + test_group_setup_assert + PROPERTIES + WILL_FAIL + 1 +) + set_tests_properties( test_group_setup_fail PROPERTIES @@ -114,6 +143,7 @@ set_tests_properties( set(OUTPUT_TESTS test_basics test_assert_macros_fail + test_groups test_skip test_setup_fail) @@ -123,32 +153,64 @@ set(TEST_OUTPUT_FMTS xml) set(test_basics_tap_out - "^\t1\\.\\.2[ \n\r]+\tok 1 - null_test_success[ \n\r]+\tok 2 - int_test_success[ \n\r]+ok - tests") + "^1\\.\\.2" + "ok 1 - null_test_success" + "ok 2 - int_test_success" + "# ok - tests") set(test_assert_macros_fail_tap_out - "^\t1\\.\\.1[ \n\r]+\tnot ok 1 - test_assert_return_code_fail[ \n\r]+\t#[^\n\r]+[\n\r]\t#[^\n\r]+[\n\r]not ok - tests") - + "^1\\.\\.1" + "not ok 1 - test_assert_return_code_fail" + "#[^\n\r]+[\n\r]#[^\n\r]+[\n\r]# not ok - tests") +set(test_groups_tap_out + "^1\\.\\.1" + "ok 1 - null_test_success" + "# ok - test_group1" + "1\\.\\.1" + "ok 1 - int_test_success" + "# ok - test_group2") set(test_skip_tap_out "not ok 1 # SKIP") set(test_setup_fail_tap_out "not ok 1 - int_test_ignored Could not run the test - check test fixtures") set(test_basics_subunit_out - "^test: null_test_success[ \n\r]+success: null_test_success") + "^test: null_test_success" + "success: null_test_success") set(test_assert_macros_fail_subunit_out "failure: test_assert_return_code_fail \\[") +set(test_groups_subunit_out + "^test: null_test_success" + "success: null_test_success") set(test_skip_subunit_out - "^test: test_check_skip[ \n\r]+skip: test_check_skip") + "^test: test_check_skip" + "skip: test_check_skip") set(test_setup_fail_subunit_out "error: int_test_ignored \\[ Could not run the test - check test fixtures \\]") set(test_basics_xml_out - "[ \n\r]+.*") + "" + ".*") set(test_assert_macros_fail_xml_out - "[ \n\r]+") + "" + "") +set(test_groups_xml_out + "^<\\?xml version=\"1.0\" encoding=\"UTF-8\" \\?>" + "" + "" + "" + "" + "" + ".*" + "" + "" + "" + "") set(test_skip_xml_out - "[ \n\r]+") + "" + "") set(test_setup_fail_xml_out - "[ \n\r]+") + "" + "") foreach(_TEST_OUTPUT_FMT ${TEST_OUTPUT_FMTS}) foreach(_OUTPUT_TEST ${OUTPUT_TESTS}) @@ -162,11 +224,20 @@ foreach(_TEST_OUTPUT_FMT ${TEST_OUTPUT_FMTS}) ENVIRONMENT CMOCKA_MESSAGE_OUTPUT=${_TEST_OUTPUT_FMT} ) - set_tests_properties( - ${TEST_NAME} - PROPERTIES - PASS_REGULAR_EXPRESSION - ${${TEST_NAME}_out} - ) + list(LENGTH ${TEST_NAME}_out len) + list(GET ${TEST_NAME}_out 0 output) + if(len GREATER 1) + list(REMOVE_AT ${TEST_NAME}_out 0) + foreach(line ${${TEST_NAME}_out}) + set(output "${output}[ \n\r]+${line}") + endforeach() + endif() + + set_tests_properties( + ${TEST_NAME} + PROPERTIES + PASS_REGULAR_EXPRESSION + ${output} + ) endforeach() endforeach() diff --git a/third_party/cmocka/tests/test_exception_handler.c b/third_party/cmocka/tests/test_exception_handler.c index 94c6842..3f7c181 100644 --- a/third_party/cmocka/tests/test_exception_handler.c +++ b/third_party/cmocka/tests/test_exception_handler.c @@ -22,6 +22,8 @@ static void test_segfault_recovery(void **state) int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(test_segfault_recovery), + cmocka_unit_test(test_segfault_recovery), + cmocka_unit_test(test_segfault_recovery), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/third_party/cmocka/tests/test_fixtures.c b/third_party/cmocka/tests/test_fixtures.c index 4597626..6d39487 100644 --- a/third_party/cmocka/tests/test_fixtures.c +++ b/third_party/cmocka/tests/test_fixtures.c @@ -31,7 +31,42 @@ static void malloc_teardown_test(void **state) assert_non_null(*state); } +static int prestate_setup(void **state) +{ + int *val = (int *)*state, *a; + + a = malloc(sizeof(int)); + *a = *val + 1; + *state = a; + + return 0; +} + +static int prestate_teardown(void **state) +{ + free(*state); + + return 0; +} + +static void prestate_setup_test(void **state) +{ + int *a = (int *)*state; + + assert_non_null(a); + assert_int_equal(*a, 43); +} + +static void prestate_test(void **state) +{ + int *a = (int *)*state; + + assert_non_null(a); + assert_int_equal(*a, 42); +} + int main(void) { + int prestate = 42; const struct CMUnitTest tests[] = { cmocka_unit_test_setup(malloc_setup_test, setup_only), cmocka_unit_test_setup(malloc_setup_test, setup_only), @@ -39,6 +74,8 @@ int main(void) { cmocka_unit_test_teardown(malloc_teardown_test, teardown_only), cmocka_unit_test_teardown(malloc_teardown_test, teardown_only), cmocka_unit_test_teardown(malloc_teardown_test, teardown_only), + cmocka_unit_test_prestate(prestate_test, &prestate), + cmocka_unit_test_prestate_setup_teardown(prestate_setup_test, prestate_setup, prestate_teardown, &prestate), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/third_party/cmocka/tests/test_group_fixtures.c b/third_party/cmocka/tests/test_group_fixtures.c index 09f39b1..64f0ab7 100644 --- a/third_party/cmocka/tests/test_group_fixtures.c +++ b/third_party/cmocka/tests/test_group_fixtures.c @@ -39,9 +39,11 @@ static void test_value_range(void **state) } int main(void) { + int prestate = 1337; const struct CMUnitTest tests[] = { cmocka_unit_test(test_value_equal), cmocka_unit_test(test_value_range), + cmocka_unit_test_prestate(test_value_equal, &prestate), }; return cmocka_run_group_tests(tests, group_setup, group_teardown); diff --git a/third_party/cmocka/tests/test_group_setup_assert.c b/third_party/cmocka/tests/test_group_setup_assert.c new file mode 100644 index 0000000..eef61f8 --- /dev/null +++ b/third_party/cmocka/tests/test_group_setup_assert.c @@ -0,0 +1,37 @@ +/* Use the unit test allocators */ +#define UNIT_TESTING 1 + +#include +#include +#include +#include + +static int group_setup_failing(void **state) +{ + (void) state; /* unused */ + + assert_int_equal(0, 1); + + return 0; +} + +static void test_true(void **state) +{ + (void) state; /* unused */ + assert_true(1); +} + +static void test_false(void **state) +{ + (void) state; /* unused */ + assert_false(0); +} + +int main(void) { + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_true), + cmocka_unit_test(test_false), + }; + + return cmocka_run_group_tests(tests, group_setup_failing, NULL); +} diff --git a/third_party/cmocka/example/run_tests.c b/third_party/cmocka/tests/test_groups.c similarity index 64% rename from third_party/cmocka/example/run_tests.c rename to third_party/cmocka/tests/test_groups.c index 817629b..af9e2b8 100644 --- a/third_party/cmocka/example/run_tests.c +++ b/third_party/cmocka/tests/test_groups.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Google Inc. + * Copyright 2016 David Schneider * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,22 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* Use the unit test allocators */ +#define UNIT_TESTING 1 + #include #include #include #include -static void setup(void **state) { +static int setup(void **state) { int *answer = malloc(sizeof(int)); assert_non_null(answer); *answer = 42; *state = answer; + + return 0; } -static void teardown(void **state) { +static int teardown(void **state) { free(*state); + + return 0; } /* A test case that does nothing and succeeds. */ @@ -45,10 +53,17 @@ static void int_test_success(void **state) { int main(void) { - const UnitTest tests[] = { - unit_test(null_test_success), - unit_test_setup_teardown(int_test_success, setup, teardown), + const struct CMUnitTest test_group1[] = { + cmocka_unit_test(null_test_success), }; - return run_tests(tests); + const struct CMUnitTest test_group2[] = { + cmocka_unit_test_setup_teardown(int_test_success, setup, teardown), + }; + + int result = 0; + result += cmocka_run_group_tests(test_group1, NULL, NULL); + result += cmocka_run_group_tests(test_group2, NULL, NULL); + + return result; } diff --git a/third_party/cmocka/tests/test_ordering.c b/third_party/cmocka/tests/test_ordering.c new file mode 100644 index 0000000..817c0ba --- /dev/null +++ b/third_party/cmocka/tests/test_ordering.c @@ -0,0 +1,112 @@ +#include "config.h" + +#include +#include +#include +#include +#include + +static void mock_test_a_called(void) +{ + function_called(); +} + +static void mock_test_b_called(void) +{ + function_called(); +} + +static void mock_test_c_called(void) +{ + function_called(); +} + + +static void test_does_succeed_for_expected(void **state) +{ + (void)state; + expect_function_call(mock_test_a_called); + expect_function_call(mock_test_a_called); + + mock_test_a_called(); + mock_test_a_called(); +} + +static void test_does_succeed_for_multiple_calls(void **state) +{ + (void)state; + expect_function_call(mock_test_a_called); + expect_function_calls(mock_test_a_called, 2); + expect_function_call(mock_test_a_called); + + mock_test_a_called(); + mock_test_a_called(); + mock_test_a_called(); + mock_test_a_called(); +} + +static void test_ordering_does_ignore_calls(void **state) +{ + (void)state; + + ignore_function_calls(mock_test_a_called); + + mock_test_a_called(); + mock_test_a_called(); + mock_test_a_called(); +} + +static void test_ordering_does_ignore_no_calls(void **state) +{ + (void)state; + ignore_function_calls(mock_test_a_called); +} + +static void test_ordering_does_expect_at_least_one_call(void **state) +{ + (void)state; + expect_function_call_any(mock_test_a_called); + + mock_test_a_called(); + mock_test_a_called(); + mock_test_a_called(); +} + +static void test_ordering_does_work_across_different_functions(void **state) +{ + (void)state; + expect_function_call(mock_test_a_called); + expect_function_call(mock_test_b_called); + expect_function_call(mock_test_a_called); + + mock_test_a_called(); + mock_test_b_called(); + mock_test_a_called(); +} + +static void test_ordering_ignores_out_of_order_properly(void **state) +{ + (void)state; + ignore_function_calls(mock_test_a_called); + ignore_function_calls(mock_test_b_called); + expect_function_calls(mock_test_c_called, 2); + + + mock_test_c_called(); + mock_test_b_called(); + mock_test_c_called(); +} + +int main(void) { + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_does_succeed_for_expected) + ,cmocka_unit_test(test_does_succeed_for_multiple_calls) + ,cmocka_unit_test(test_ordering_does_ignore_no_calls) + ,cmocka_unit_test(test_ordering_does_ignore_calls) + ,cmocka_unit_test(test_ordering_does_expect_at_least_one_call) + ,cmocka_unit_test(test_ordering_does_work_across_different_functions) + ,cmocka_unit_test(test_ordering_ignores_out_of_order_properly) + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/third_party/cmocka/tests/test_ordering_fail.c b/third_party/cmocka/tests/test_ordering_fail.c new file mode 100644 index 0000000..652f5ad --- /dev/null +++ b/third_party/cmocka/tests/test_ordering_fail.c @@ -0,0 +1,95 @@ +#include "config.h" + +#include +#include +#include +#include +#include + +static void mock_test_a_called(void) +{ + function_called(); +} + +static void mock_test_b_called(void) +{ + function_called(); +} + +static void mock_test_c_called(void) +{ + function_called(); +} + +static void test_does_fail_for_unexpected_call(void **state) +{ + (void)state; + expect_function_call(mock_test_a_called); + expect_function_call(mock_test_a_called); + + mock_test_a_called(); + mock_test_a_called(); + mock_test_a_called(); +} + +static void test_does_fail_for_unmade_expected_call(void **state) +{ + (void)state; + expect_function_call(mock_test_a_called); + expect_function_call(mock_test_a_called); + + mock_test_a_called(); +} + +static void test_ordering_fails_out_of_order(void **state) +{ + (void)state; + expect_function_call(mock_test_a_called); + expect_function_call(mock_test_b_called); + expect_function_call(mock_test_a_called); + + mock_test_b_called(); +} + +static void test_ordering_fails_out_of_order_for_at_least_once_calls(void **state) +{ + (void)state; + expect_function_call_any(mock_test_a_called); + ignore_function_calls(mock_test_b_called); + + mock_test_b_called(); + mock_test_c_called(); +} + +/* Primarily used to test error message */ +static void test_fails_out_of_order_if_no_calls_found_on_any(void **state) +{ + (void)state; + expect_function_call_any(mock_test_a_called); + ignore_function_calls(mock_test_b_called); + + mock_test_a_called(); + mock_test_c_called(); +} + +static void test_fails_if_zero_count_used(void **state) +{ + (void)state; + expect_function_calls(mock_test_a_called, 0); + + mock_test_a_called(); +} + +int main(void) { + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_does_fail_for_unexpected_call) + ,cmocka_unit_test(test_does_fail_for_unmade_expected_call) + ,cmocka_unit_test(test_does_fail_for_unmade_expected_call) + ,cmocka_unit_test(test_ordering_fails_out_of_order) + ,cmocka_unit_test(test_ordering_fails_out_of_order_for_at_least_once_calls) + ,cmocka_unit_test(test_fails_out_of_order_if_no_calls_found_on_any) + ,cmocka_unit_test(test_fails_if_zero_count_used) + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/third_party/cmocka/tests/test_returns.c b/third_party/cmocka/tests/test_returns.c new file mode 100644 index 0000000..b9370c9 --- /dev/null +++ b/third_party/cmocka/tests/test_returns.c @@ -0,0 +1,69 @@ +#include "config.h" + +#include +#include +#include +#include +#include + +#include + +int mock_function(void); +void mock_function_call_times(size_t times, int expectedValue); + +int mock_function(void) +{ + return (int) mock(); +} + +void mock_function_call_times(size_t times, int expectedValue) +{ + size_t i; + for (i = 0u; i < times; ++i) + { + assert_int_equal(expectedValue, mock_function()); + } +} + +static void test_will_return_maybe_for_no_calls(void **state) +{ + (void) state; + + will_return_maybe(mock_function, 32); +} + +static void test_will_return_maybe_for_one_mock_call(void **state) +{ + int value; + + (void) state; + + value = rand(); + will_return_maybe(mock_function, value); + mock_function_call_times(1u, value); +} + +static void test_will_return_maybe_for_more_than_one_call(void **state) +{ + int value; + size_t numberOfCalls; + (void)state; + + value = rand(); + numberOfCalls = (size_t) ((rand()) % 20 + 2); + will_return_maybe(mock_function, value); + mock_function_call_times(numberOfCalls, value); +} + +int main(int argc, char **argv) { + const struct CMUnitTest alloc_tests[] = { + cmocka_unit_test(test_will_return_maybe_for_no_calls) + ,cmocka_unit_test(test_will_return_maybe_for_one_mock_call) + ,cmocka_unit_test(test_will_return_maybe_for_more_than_one_call) + }; + + (void)argc; + (void)argv; + + return cmocka_run_group_tests(alloc_tests, NULL, NULL); +} diff --git a/third_party/cmocka/tests/test_returns_fail.c b/third_party/cmocka/tests/test_returns_fail.c new file mode 100644 index 0000000..81197d3 --- /dev/null +++ b/third_party/cmocka/tests/test_returns_fail.c @@ -0,0 +1,77 @@ +#include "config.h" + +#include +#include +#include +#include +#include + +#include + +int mock_function(void); +void mock_function_call_times(size_t times, int expectedValue); + +int mock_function(void) +{ + return (int) mock(); +} + +void mock_function_call_times(size_t times, int expectedValue) +{ + size_t i; + for (i = 0u; i < times; ++i) + { + assert_int_equal(expectedValue, mock_function()); + } +} + +static void test_will_return_fails_for_no_calls(void **state) +{ + (void) state; + + will_return(mock_function, 32); +} + +static void test_will_return_count_fails_for_unreturned_items(void **state) +{ + int value; + size_t numberOfCalls; + + (void) state; + + value = rand(); + numberOfCalls = (size_t) ((rand()) % 20 + 2); + + will_return_count(mock_function, value, numberOfCalls); + mock_function_call_times(numberOfCalls - 1u, value); +} + +static void test_will_return_always_fails_for_no_calls(void **state) +{ + int value; + + (void) state; + + value = rand(); + + will_return_always(mock_function, value); +} + +static int teardown(void **state) { + free(*state); + + return 0; +} + +int main(int argc, char **argv) { + const struct CMUnitTest alloc_tests[] = { + cmocka_unit_test_teardown(test_will_return_fails_for_no_calls, teardown) + ,cmocka_unit_test_teardown(test_will_return_count_fails_for_unreturned_items, teardown) + ,cmocka_unit_test_teardown(test_will_return_always_fails_for_no_calls, teardown) + }; + + (void)argc; + (void)argv; + + return cmocka_run_group_tests(alloc_tests, NULL, NULL); +} From b51480191f0db29f85ac2083add9970ac540b890 Mon Sep 17 00:00:00 2001 From: Michael M Date: Thu, 7 Sep 2017 21:53:29 -0700 Subject: [PATCH 2/3] third_party/threads: allow building for macOS Signed-off-by: Michael M --- third_party/threads/threads.h | 2 +- third_party/threads/threads_posix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/threads/threads.h b/third_party/threads/threads.h index 5d73102..b4db50c 100644 --- a/third_party/threads/threads.h +++ b/third_party/threads/threads.h @@ -86,7 +86,7 @@ typedef struct once_flag_t { } once_flag; #endif -#elif defined(__unix__) || defined(__unix) +#elif defined(__unix__) || defined(__unix) || defined(__APPLE__) #include /*---------------------------- macros ----------------------------*/ diff --git a/third_party/threads/threads_posix.c b/third_party/threads/threads_posix.c index e122bf9..490f0df 100644 --- a/third_party/threads/threads_posix.c +++ b/third_party/threads/threads_posix.c @@ -45,7 +45,7 @@ Configuration macro: Use pthread_mutex_timedlock() for `mtx_timedlock()' Otherwise use mtx_trylock() + *busy loop* emulation. */ -#if !defined(__CYGWIN__) && !defined(ANDROID) +#if !defined(__CYGWIN__) && !defined(ANDROID) && !defined(__APPLE__) #define EMULATED_THREADS_USE_NATIVE_TIMEDLOCK #endif From 9b61c618f21bc44073530b310d8d80866fd444b0 Mon Sep 17 00:00:00 2001 From: Michael M Date: Thu, 7 Sep 2017 21:53:42 -0700 Subject: [PATCH 3/3] tests/gl_basic_test: copy definition of removeXcodeArgs This fixes compilation on macOS. Signed-off-by: Michael M --- tests/functional/gl_basic_test.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index c3c7774..4098d8d 100644 --- a/tests/functional/gl_basic_test.c +++ b/tests/functional/gl_basic_test.c @@ -760,6 +760,34 @@ CREATE_TESTSUITE(WAFFLE_PLATFORM_WGL, wgl) #undef test_XX_rgba #undef test_XX_rgb +#ifdef __APPLE__ + +static void +removeArg(int index, int *argc, char **argv) +{ + --*argc; + for (; index < *argc; ++index) + argv[index] = argv[index + 1]; +} + +static void +removeXcodeArgs(int *argc, char **argv) +{ + // Xcode sometimes adds additional arguments. + for (int i = 1; i < *argc; ) + { + if (strcmp(argv[i], "-NSDocumentRevisionsDebugMode") == 0 || + strcmp(argv[i], "-ApplePersistenceIgnoreState" ) == 0) + { + removeArg(i, argc, argv); + removeArg(i, argc, argv); + } else + ++i; + } +} + +#endif // __APPLE__ + static const char *usage_message = "Usage:\n" " gl_basic_test [Options]\n"