1
0
mirror of https://git.suyu.dev/suyu/suyu synced 2025-09-16 02:58:00 -05:00

Initial commit

This commit is contained in:
Crimson-Hawk
2024-03-05 16:42:40 +08:00
commit f1e4595ebf
39576 changed files with 7006612 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
set(VCPKG_DETECTED_CMAKE_CROSSCOMPILING "OFF")
set(VCPKG_DETECTED_CMAKE_SYSTEM_NAME "Windows")
set(VCPKG_DETECTED_CMAKE_HOST_SYSTEM_NAME "Windows")
set(VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR "AMD64")
set(VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
set(VCPKG_DETECTED_CMAKE_SIZEOF_VOID_P "8")
set(VCPKG_DETECTED_MSVC "1")
set(VCPKG_DETECTED_MSVC_VERSION "1929")
set(VCPKG_DETECTED_CMAKE_AR "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/lib.exe")
set(VCPKG_DETECTED_CMAKE_RANLIB ":")
set(VCPKG_DETECTED_CMAKE_STRIP "")
set(VCPKG_DETECTED_CMAKE_NM "")
set(VCPKG_DETECTED_CMAKE_OBJDUMP "")
set(VCPKG_DETECTED_CMAKE_DLLTOOL "")
set(VCPKG_DETECTED_CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64/mt.exe")
set(VCPKG_DETECTED_CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/link.exe")
set(VCPKG_DETECTED_CMAKE_C_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe")
set(VCPKG_DETECTED_CMAKE_C_COMPILER_ID "MSVC")
set(VCPKG_DETECTED_CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe")
set(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID "MSVC")
set(VCPKG_DETECTED_CMAKE_RC_COMPILER "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64/rc.exe")
set(VCPKG_DETECTED_CMAKE_RC_COMPILER_ID "")
set(VCPKG_DETECTED_CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "")
set(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
set(VCPKG_DETECTED_CMAKE_C_STANDARD "")
set(VCPKG_DETECTED_CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17")
set(VCPKG_DETECTED_CMAKE_C_EXTENSION "")
set(VCPKG_DETECTED_CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "")
set(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
set(VCPKG_DETECTED_CMAKE_CXX_STANDARD "")
set(VCPKG_DETECTED_CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23")
set(VCPKG_DETECTED_CMAKE_CXX_EXTENSION "")
set(VCPKG_DETECTED_CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ")
set(VCPKG_DETECTED_CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ")
set(VCPKG_DETECTED_CMAKE_RC_FLAGS "-c65001 /DWIN32")
set(VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS "/machine:x64")
set(VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS "/machine:x64")
set(VCPKG_DETECTED_CMAKE_EXE_LINKER_FLAGS "/machine:x64")
set(VCPKG_DETECTED_ENV_PATH "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE//Extensions/Microsoft/IntelliCode/CLI;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/VC/VCPackages;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TestWindow;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/bin/Roslyn;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Team Tools/Performance Tools/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Team Tools/Performance Tools;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019//x64;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/;C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/x64/;C:/Program Files (x86)/HTML Help Workshop;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/devinit;C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64;C:/Program Files (x86)/Windows Kits/10/bin/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise//MSBuild/Current/Bin;C:/Windows/Microsoft.NET/Framework64/v4.0.30319;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/;C:/Program Files/PowerShell/7;C:/Windows/system32;C:/Windows;C:/Windows/system32/Wbem;C:/Windows/system32/WindowsPowerShell/v1.0/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/Llvm/x64/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/VC/Linux/bin/ConnectionManagerExe;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja")
set(VCPKG_DETECTED_ENV_INCLUDE "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/ATLMFC/include;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/include;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/include/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/ucrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/shared;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/winrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/cppwinrt")
set(VCPKG_DETECTED_ENV_C_INCLUDE_PATH "")
set(VCPKG_DETECTED_ENV_CPLUS_INCLUDE_PATH "")
set(VCPKG_DETECTED_ENV_LIB "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/ATLMFC/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/lib/x64;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/lib/um/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.22000.0/ucrt/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.22000.0/um/x64")
set(VCPKG_DETECTED_ENV_LIBPATH "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/ATLMFC/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/lib/x86/store/references;C:/Program Files (x86)/Windows Kits/10/UnionMetadata/10.0.22000.0;C:/Program Files (x86)/Windows Kits/10/References/10.0.22000.0;C:/Windows/Microsoft.NET/Framework64/v4.0.30319")
set(VCPKG_DETECTED_ENV_LIBRARY_PATH "")
set(VCPKG_DETECTED_ENV_LD_LIBRARY_PATH "")
set(VCPKG_COMBINED_CXX_FLAGS_DEBUG " -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -GR -EHsc -MP -D_DEBUG -MDd -Z7 -Ob0 -Od -RTC1 ")
set(VCPKG_COMBINED_C_FLAGS_DEBUG " -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -MP -D_DEBUG -MDd -Z7 -Ob0 -Od -RTC1 ")
set(VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG "-machine:x64 -nologo -debug -INCREMENTAL ")
set(VCPKG_COMBINED_EXE_LINKER_FLAGS_DEBUG "-machine:x64 -nologo -debug -INCREMENTAL ")
set(VCPKG_COMBINED_STATIC_LINKER_FLAGS_DEBUG "-machine:x64 -nologo")
set(VCPKG_COMBINED_RC_FLAGS_DEBUG "-c65001 -DWIN32 -D_DEBUG")

View File

@@ -0,0 +1,50 @@
[1/2] cmd /c "cd ../../x64-windows-dbg && "C:/Program Files/CMake/bin/cmake.exe" "D:/a/1/s/build/vcpkg_installed/x64-windows/share/vcpkg-cmake-get-vars/cmake_get_vars" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/a/1/s/externals/vcpkg/packages/boost-test_x64-windows/debug" "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/a/1/s/externals/vcpkg" "-D_VCPKG_INSTALLED_DIR=D:/a/1/s/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DVCPKG_OUTPUT_FILE:PATH=D:/a/1/s/externals/vcpkg/buildtrees/boost-test/cmake-get-vars-x64-windows-dbg.cmake.log""
-- The C compiler identification is MSVC 19.29.30146.0
-- The CXX compiler identification is MSVC 19.29.30146.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_SHARED_LIBS
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
_VCPKG_ROOT_DIR
-- Build files have been written to: D:/a/1/s/externals/vcpkg/buildtrees/boost-test/x64-windows-dbg
[2/2] cmd /c "cd .. && "C:/Program Files/CMake/bin/cmake.exe" "D:/a/1/s/build/vcpkg_installed/x64-windows/share/vcpkg-cmake-get-vars/cmake_get_vars" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=D:/a/1/s/externals/vcpkg/packages/boost-test_x64-windows" "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/a/1/s/externals/vcpkg" "-D_VCPKG_INSTALLED_DIR=D:/a/1/s/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DVCPKG_OUTPUT_FILE:PATH=D:/a/1/s/externals/vcpkg/buildtrees/boost-test/cmake-get-vars-x64-windows-rel.cmake.log""
-- The C compiler identification is MSVC 19.29.30146.0
-- The CXX compiler identification is MSVC 19.29.30146.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_SHARED_LIBS
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
_VCPKG_ROOT_DIR
-- Build files have been written to: D:/a/1/s/externals/vcpkg/buildtrees/boost-test/x64-windows-rel

View File

@@ -0,0 +1,52 @@
set(VCPKG_DETECTED_CMAKE_CROSSCOMPILING "OFF")
set(VCPKG_DETECTED_CMAKE_SYSTEM_NAME "Windows")
set(VCPKG_DETECTED_CMAKE_HOST_SYSTEM_NAME "Windows")
set(VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR "AMD64")
set(VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
set(VCPKG_DETECTED_CMAKE_SIZEOF_VOID_P "8")
set(VCPKG_DETECTED_MSVC "1")
set(VCPKG_DETECTED_MSVC_VERSION "1929")
set(VCPKG_DETECTED_CMAKE_AR "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/lib.exe")
set(VCPKG_DETECTED_CMAKE_RANLIB ":")
set(VCPKG_DETECTED_CMAKE_STRIP "")
set(VCPKG_DETECTED_CMAKE_NM "")
set(VCPKG_DETECTED_CMAKE_OBJDUMP "")
set(VCPKG_DETECTED_CMAKE_DLLTOOL "")
set(VCPKG_DETECTED_CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64/mt.exe")
set(VCPKG_DETECTED_CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/link.exe")
set(VCPKG_DETECTED_CMAKE_C_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe")
set(VCPKG_DETECTED_CMAKE_C_COMPILER_ID "MSVC")
set(VCPKG_DETECTED_CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe")
set(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID "MSVC")
set(VCPKG_DETECTED_CMAKE_RC_COMPILER "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64/rc.exe")
set(VCPKG_DETECTED_CMAKE_RC_COMPILER_ID "")
set(VCPKG_DETECTED_CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "")
set(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
set(VCPKG_DETECTED_CMAKE_C_STANDARD "")
set(VCPKG_DETECTED_CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17")
set(VCPKG_DETECTED_CMAKE_C_EXTENSION "")
set(VCPKG_DETECTED_CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "")
set(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
set(VCPKG_DETECTED_CMAKE_CXX_STANDARD "")
set(VCPKG_DETECTED_CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23")
set(VCPKG_DETECTED_CMAKE_CXX_EXTENSION "")
set(VCPKG_DETECTED_CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ")
set(VCPKG_DETECTED_CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ")
set(VCPKG_DETECTED_CMAKE_RC_FLAGS "-c65001 /DWIN32")
set(VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS "/machine:x64")
set(VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS "/machine:x64")
set(VCPKG_DETECTED_CMAKE_EXE_LINKER_FLAGS "/machine:x64")
set(VCPKG_DETECTED_ENV_PATH "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE//Extensions/Microsoft/IntelliCode/CLI;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/VC/VCPackages;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TestWindow;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/bin/Roslyn;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Team Tools/Performance Tools/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Team Tools/Performance Tools;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019//x64;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/;C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/x64/;C:/Program Files (x86)/HTML Help Workshop;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/devinit;C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64;C:/Program Files (x86)/Windows Kits/10/bin/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise//MSBuild/Current/Bin;C:/Windows/Microsoft.NET/Framework64/v4.0.30319;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/;C:/Program Files/PowerShell/7;C:/Windows/system32;C:/Windows;C:/Windows/system32/Wbem;C:/Windows/system32/WindowsPowerShell/v1.0/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/Llvm/x64/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/VC/Linux/bin/ConnectionManagerExe;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja")
set(VCPKG_DETECTED_ENV_INCLUDE "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/ATLMFC/include;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/include;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/include/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/ucrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/shared;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/um;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/winrt;C:/Program Files (x86)/Windows Kits/10/include/10.0.22000.0/cppwinrt")
set(VCPKG_DETECTED_ENV_C_INCLUDE_PATH "")
set(VCPKG_DETECTED_ENV_CPLUS_INCLUDE_PATH "")
set(VCPKG_DETECTED_ENV_LIB "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/ATLMFC/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/lib/x64;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/lib/um/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.22000.0/ucrt/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.22000.0/um/x64")
set(VCPKG_DETECTED_ENV_LIBPATH "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/ATLMFC/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/lib/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/lib/x86/store/references;C:/Program Files (x86)/Windows Kits/10/UnionMetadata/10.0.22000.0;C:/Program Files (x86)/Windows Kits/10/References/10.0.22000.0;C:/Windows/Microsoft.NET/Framework64/v4.0.30319")
set(VCPKG_DETECTED_ENV_LIBRARY_PATH "")
set(VCPKG_DETECTED_ENV_LD_LIBRARY_PATH "")
set(VCPKG_COMBINED_CXX_FLAGS_RELEASE " -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -GR -EHsc -MP -MD -O2 -Oi -Gy -DNDEBUG -Z7 ")
set(VCPKG_COMBINED_C_FLAGS_RELEASE " -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -MP -MD -O2 -Oi -Gy -DNDEBUG -Z7 ")
set(VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE "-machine:x64 -nologo -DEBUG -INCREMENTAL:NO -OPT:REF -OPT:ICF ")
set(VCPKG_COMBINED_EXE_LINKER_FLAGS_RELEASE "-machine:x64 -nologo -DEBUG -INCREMENTAL:NO -OPT:REF -OPT:ICF ")
set(VCPKG_COMBINED_STATIC_LINKER_FLAGS_RELEASE "-machine:x64 -nologo")
set(VCPKG_COMBINED_RC_FLAGS_RELEASE "-c65001 -DWIN32 ")

View File

@@ -0,0 +1,2 @@
include("${CMAKE_CURRENT_LIST_DIR}/cmake-get-vars-x64-windows-rel.cmake.log")
include("${CMAKE_CURRENT_LIST_DIR}/cmake-get-vars-x64-windows-dbg.cmake.log")

View File

@@ -0,0 +1,26 @@
[1/2] cmd /c "cd ../../x64-windows-dbg && "C:/Program Files/CMake/bin/cmake.exe" "D:/a/1/s/build/vcpkg_installed/x64-windows/share/boost-build" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/a/1/s/externals/vcpkg/packages/boost-test_x64-windows/debug" "-DPORT=boost-test" "-DFEATURES=core" "-DWITH_PYTHON2=OFF" "-DWITH_PYTHON3=OFF" "-DCURRENT_INSTALLED_DIR=D:/a/1/s/build/vcpkg_installed/x64-windows" "-DB2_EXE=D:/a/1/s/build/vcpkg_installed/x64-windows/tools/boost-build/b2.exe" "-DSOURCE_PATH=D:/a/1/s/externals/vcpkg/buildtrees/boost-test/src/ost-1.79.0-e87d79ffc5.clean" "-DBOOST_BUILD_PATH=D:/a/1/s/build/vcpkg_installed/x64-windows/tools/boost-build" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_CMAKE_VARS_FILE=D:/a/1/s/externals/vcpkg/buildtrees/boost-test/cmake-get-vars-x64-windows.cmake.log" "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/a/1/s/externals/vcpkg" "-D_VCPKG_INSTALLED_DIR=D:/a/1/s/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF""
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
FEATURES
_VCPKG_ROOT_DIR
-- Build files have been written to: D:/a/1/s/externals/vcpkg/buildtrees/boost-test/x64-windows-dbg
[2/2] cmd /c "cd .. && "C:/Program Files/CMake/bin/cmake.exe" "D:/a/1/s/build/vcpkg_installed/x64-windows/share/boost-build" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=D:/a/1/s/externals/vcpkg/packages/boost-test_x64-windows" "-DPORT=boost-test" "-DFEATURES=core" "-DWITH_PYTHON2=OFF" "-DWITH_PYTHON3=OFF" "-DCURRENT_INSTALLED_DIR=D:/a/1/s/build/vcpkg_installed/x64-windows" "-DB2_EXE=D:/a/1/s/build/vcpkg_installed/x64-windows/tools/boost-build/b2.exe" "-DSOURCE_PATH=D:/a/1/s/externals/vcpkg/buildtrees/boost-test/src/ost-1.79.0-e87d79ffc5.clean" "-DBOOST_BUILD_PATH=D:/a/1/s/build/vcpkg_installed/x64-windows/tools/boost-build" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_CMAKE_VARS_FILE=D:/a/1/s/externals/vcpkg/buildtrees/boost-test/cmake-get-vars-x64-windows.cmake.log" "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=D:/a/1/s/externals/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/a/1/s/externals/vcpkg" "-D_VCPKG_INSTALLED_DIR=D:/a/1/s/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF""
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
FEATURES
_VCPKG_ROOT_DIR
-- Build files have been written to: D:/a/1/s/externals/vcpkg/buildtrees/boost-test/x64-windows-rel

View File

View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,96 @@
* text=auto !eol svneol=native#text/plain
*.gitattributes text svneol=native#text/plain
# Scriptish formats
*.bat text svneol=native#text/plain
*.bsh text svneol=native#text/x-beanshell
*.cgi text svneol=native#text/plain
*.cmd text svneol=native#text/plain
*.js text svneol=native#text/javascript
*.php text svneol=native#text/x-php
*.pl text svneol=native#text/x-perl
*.pm text svneol=native#text/x-perl
*.py text svneol=native#text/x-python
*.sh eol=lf svneol=LF#text/x-sh
configure eol=lf svneol=LF#text/x-sh
# Image formats
*.bmp binary svneol=unset#image/bmp
*.gif binary svneol=unset#image/gif
*.ico binary svneol=unset#image/ico
*.jpeg binary svneol=unset#image/jpeg
*.jpg binary svneol=unset#image/jpeg
*.png binary svneol=unset#image/png
*.tif binary svneol=unset#image/tiff
*.tiff binary svneol=unset#image/tiff
*.svg text svneol=native#image/svg%2Bxml
# Data formats
*.pdf binary svneol=unset#application/pdf
*.avi binary svneol=unset#video/avi
*.doc binary svneol=unset#application/msword
*.dsp text svneol=crlf#text/plain
*.dsw text svneol=crlf#text/plain
*.eps binary svneol=unset#application/postscript
*.gz binary svneol=unset#application/gzip
*.mov binary svneol=unset#video/quicktime
*.mp3 binary svneol=unset#audio/mpeg
*.ppt binary svneol=unset#application/vnd.ms-powerpoint
*.ps binary svneol=unset#application/postscript
*.psd binary svneol=unset#application/photoshop
*.rdf binary svneol=unset#text/rdf
*.rss text svneol=unset#text/xml
*.rtf binary svneol=unset#text/rtf
*.sln text svneol=native#text/plain
*.swf binary svneol=unset#application/x-shockwave-flash
*.tgz binary svneol=unset#application/gzip
*.vcproj text svneol=native#text/xml
*.vcxproj text svneol=native#text/xml
*.vsprops text svneol=native#text/xml
*.wav binary svneol=unset#audio/wav
*.xls binary svneol=unset#application/vnd.ms-excel
*.zip binary svneol=unset#application/zip
# Text formats
.htaccess text svneol=native#text/plain
*.bbk text svneol=native#text/xml
*.cmake text svneol=native#text/plain
*.css text svneol=native#text/css
*.dtd text svneol=native#text/xml
*.htm text svneol=native#text/html
*.html text svneol=native#text/html
*.ini text svneol=native#text/plain
*.log text svneol=native#text/plain
*.mak text svneol=native#text/plain
*.qbk text svneol=native#text/plain
*.rst text svneol=native#text/plain
*.sql text svneol=native#text/x-sql
*.txt text svneol=native#text/plain
*.xhtml text svneol=native#text/xhtml%2Bxml
*.xml text svneol=native#text/xml
*.xsd text svneol=native#text/xml
*.xsl text svneol=native#text/xml
*.xslt text svneol=native#text/xml
*.xul text svneol=native#text/xul
*.yml text svneol=native#text/plain
boost-no-inspect text svneol=native#text/plain
CHANGES text svneol=native#text/plain
COPYING text svneol=native#text/plain
INSTALL text svneol=native#text/plain
Jamfile text svneol=native#text/plain
Jamroot text svneol=native#text/plain
Jamfile.v2 text svneol=native#text/plain
Jamrules text svneol=native#text/plain
Makefile* text svneol=native#text/plain
README text svneol=native#text/plain
TODO text svneol=native#text/plain
# Code formats
*.c text svneol=native#text/plain
*.cpp text svneol=native#text/plain
*.h text svneol=native#text/plain
*.hpp text svneol=native#text/plain
*.ipp text svneol=native#text/plain
*.tpp text svneol=native#text/plain
*.jam text svneol=native#text/plain
*.java text svneol=native#text/plain

View File

@@ -0,0 +1,15 @@
.vscode/
doc/**/build
doc/html/*.html
doc/html/header/
doc/html/boost*/
doc/html/standalone_HTML.manifest
doc/doxygen
test_executable
doxygen_reference_generated_doc.xml
standalonedoc_HTML.manifest
Master_Test_Suite*.xml
smoke-ts-sink*.*
build/tmp
build/build_dir
build/build_*

View File

@@ -0,0 +1,115 @@
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_test VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
# Dependencies (please retain formatting, one target per line, no punct.)
set(_boost_test_dependencies
Boost::algorithm
Boost::assert
Boost::bind
Boost::config
Boost::core
Boost::detail
Boost::exception
Boost::function
Boost::io
Boost::iterator
Boost::mpl
Boost::numeric_conversion
Boost::optional
Boost::preprocessor
Boost::smart_ptr
Boost::static_assert
Boost::type_traits
Boost::utility
)
# Compiled targets
function(boost_test_add_library name)
add_library(boost_${name} ${ARGN})
add_library(Boost::${name} ALIAS boost_${name})
target_include_directories(boost_${name} PUBLIC include)
target_link_libraries(boost_${name} PUBLIC ${_boost_test_dependencies})
target_compile_definitions(boost_${name}
PUBLIC BOOST_TEST_NO_LIB
# Source files already define BOOST_TEST_SOURCE
# PRIVATE BOOST_TEST_SOURCE
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_DYN_LINK)
else()
target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_STATIC_LINK)
endif()
endfunction()
boost_test_add_library(prg_exec_monitor
src/cpp_main.cpp
src/debug.cpp
src/execution_monitor.cpp
)
set(SOURCES
src/compiler_log_formatter.cpp
src/debug.cpp
src/decorator.cpp
src/execution_monitor.cpp
src/framework.cpp
src/junit_log_formatter.cpp
src/plain_report_formatter.cpp
src/progress_monitor.cpp
src/results_collector.cpp
src/results_reporter.cpp
src/test_framework_init_observer.cpp
src/test_tools.cpp
src/test_tree.cpp
src/unit_test_log.cpp
src/unit_test_main.cpp
src/unit_test_monitor.cpp
src/unit_test_parameters.cpp
src/xml_log_formatter.cpp
src/xml_report_formatter.cpp
)
boost_test_add_library(test_exec_monitor STATIC ${SOURCES} src/test_main.cpp)
boost_test_add_library(unit_test_framework ${SOURCES})
# Header-only targets
function(boost_test_add_included_library name)
add_library(boost_${name} INTERFACE)
add_library(Boost::${name} ALIAS boost_${name})
target_include_directories(boost_${name} INTERFACE include)
target_link_libraries(boost_${name} INTERFACE ${_boost_test_dependencies})
endfunction()
boost_test_add_included_library(included_prg_exec_monitor)
boost_test_add_included_library(included_test_exec_monitor)
boost_test_add_included_library(included_unit_test_framework)
# Installation
if(BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13)
boost_install(
TARGETS
boost_prg_exec_monitor boost_test_exec_monitor boost_unit_test_framework
boost_included_prg_exec_monitor boost_included_test_exec_monitor boost_included_unit_test_framework
VERSION ${BOOST_SUPERPROJECT_VERSION}
HEADER_DIRECTORY include
)
endif()

View File

@@ -0,0 +1,26 @@
# How to contribute to Boost.Test
## Ticket
We like having a ticket stating the bug you are experiencing or the feature you want to implement.
We use the [GitHub issues](https://github.com/boostorg/test/issues) for raising bugs and feature requests,
while older tickets may be found in our former bug tracking system at https://svn.boost.org/
(`test` component).
## Pull requests
We welcome any contribution in the form of a pull request. Each PR is never integrated exactly as submitted,
we first run our internal unit tests on several platforms, and work the PR if needed.
To ease the work of the maintainer and make the integration of your changes faster, please
- base all your PR on the latest develop, rebase if develop changed since you forked the library
- ensure that your changes are not creating any regression in the current test bed (see below on how to run
the unit tests)
- provide a test case that reproduces the problem you encountered
- integrate your unit test into the `Jamfile.v2` of the test folder
# Running the unit tests
Please make sure that the current set of tests pass for the changes that you submit.
To run the tests, see [this document](test/README.md).
# Compile the documentation
The instructions for compiling the documentation are provided in [this document](doc/README.md).

View File

@@ -0,0 +1,9 @@
# (C) Copyright Juergen Hunold 2006-2010.
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org/libs/test for the library home page.
build-project example ;
build-project test ;

View File

@@ -0,0 +1,180 @@
constant BOOST_VERSION : 1.79.0 ;
constant BOOST_VERSION_ABI_TAG : 1_79 ;
constant BOOST_JAMROOT_MODULE : $(__name__) ;
import boostcpp ;
import feature ;
boostcpp.set-version $(BOOST_VERSION) ;
project boost : requirements
<include>include&&"D:/a/1/s/build/vcpkg_installed/x64-windows/include"
<define>BOOST_ALL_NO_LIB=1
<tag>@$(__name__).tag
;
rule boost-install ( libraries * )
{
stagedir = [ option.get stagedir ] ;
install stage
: $(libraries)
: <location>$(stagedir)/lib ;
}
rule tag ( name : type ? : property-set )
{
return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
}
rule python-tag ( name : type ? : property-set )
{
return [ boostcpp.python-tag $(name) : $(type) : $(property-set) ] ;
}
if "boost-test" != "boost-system"
{
use-project /boost/system : . ;
lib boost_system : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_system-vc140-mt.lib" <variant>release ;
lib boost_system : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_system-vc140-mt-gd.lib" <variant>debug ;
explicit boost_system ;
use-project /boost : . ;
alias system : boost_system ;
}
if "boost-test" != "boost-chrono"
{
use-project /boost/chrono : . ;
lib boost_chrono : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_chrono-vc140-mt.lib" <variant>release ;
lib boost_chrono : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_chrono-vc140-mt-gd.lib" <variant>debug ;
explicit boost_chrono ;
}
if "boost-test" != "boost-regex"
{
use-project /boost/regex : . ;
lib boost_regex : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_regex-vc140-mt.lib" <variant>release ;
lib boost_regex : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_regex-vc140-mt-gd.lib" <variant>debug ;
explicit boost_regex ;
}
if "boost-test" != "boost-date-time"
{
use-project /boost/date_time : . ;
lib boost_date_time : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_date_time-vc140-mt.lib" <variant>release -<library>/boost/date_time//boost_date_time ;
lib boost_date_time : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_date_time-vc140-mt-gd.lib" <variant>debug -<library>/boost/date_time//boost_date_time ;
explicit boost_date_time ;
}
if "boost-test" != "boost-thread"
{
use-project /boost/thread : . ;
lib boost_thread : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_thread-vc140-mt.lib" <variant>release : : <library>/boost/date_time//boost_date_time ;
lib boost_thread : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_thread-vc140-mt-gd.lib" <variant>debug : : <library>/boost/date_time//boost_date_time ;
explicit boost_thread ;
}
if "boost-test" != "boost-timer"
{
use-project /boost/timer : . ;
lib boost_timer : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_timer-vc140-mt.lib" <variant>release ;
lib boost_timer : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_timer-vc140-mt-gd.lib" <variant>debug ;
explicit boost_timer ;
}
if "boost-test" != "boost-filesystem"
{
use-project /boost/filesystem : . ;
lib boost_filesystem : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_filesystem-vc140-mt.lib" <variant>release : : <library>/boost/system//boost_system ;
lib boost_filesystem : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_filesystem-vc140-mt-gd.lib" <variant>debug : : <library>/boost/system//boost_system ;
explicit boost_filesystem ;
}
if "boost-test" != "boost-atomic"
{
use-project /boost/atomic : . ;
lib boost_atomic : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_atomic-vc140-mt.lib" <variant>release ;
lib boost_atomic : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_atomic-vc140-mt-gd.lib" <variant>debug ;
explicit boost_atomic ;
}
if "boost-test" != "boost-context"
{
feature.feature segmented-stacks : on : optional propagated composite ;
feature.compose <segmented-stacks>on : <define>BOOST_USE_SEGMENTED_STACKS ;
use-project /boost/context : . ;
lib boost_context : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_context-vc140-mt.lib" <variant>release ;
lib boost_context : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_context-vc140-mt-gd.lib" <variant>debug ;
explicit boost_context ;
}
if "boost-test" != "boost-test"
{
use-project /boost/test : . ;
lib boost_unit_test_framework : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_unit_test_framework-vc140-mt.lib" <variant>release ;
lib boost_unit_test_framework : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_unit_test_framework-vc140-mt-gd.lib" <variant>debug ;
explicit boost_unit_test_framework ;
}
if "boost-test" != "boost-serialization"
{
use-project /boost/serialization : . ;
lib boost_serialization : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_serialization-vc140-mt.lib" <variant>release ;
lib boost_serialization : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_serialization-vc140-mt-gd.lib" <variant>debug ;
explicit boost_serialization ;
}
if "boost-test" != "boost-mpi"
{
use-project /boost/mpi : . ;
lib boost_mpi : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_mpi-vc140-mt.lib" <variant>release : : <library>/boost/serialization//boost_serialization ;
lib boost_mpi : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_mpi-vc140-mt-gd.lib" <variant>debug : : <library>/boost/serialization//boost_serialization ;
explicit boost_mpi ;
}
if "boost-test" != "boost-container"
{
use-project /boost/container : . ;
lib boost_container : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_container-vc140-mt.lib" <variant>release ;
lib boost_container : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_container-vc140-mt-gd.lib" <variant>debug ;
explicit boost_container ;
}
if "boost-test" != "boost-python"
{
use-project /boost/python : . ;
lib boost_python : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/lib/boost_python-vc140-mt.lib" <variant>release ;
lib boost_python : : <file>"D:/a/1/s/build/vcpkg_installed/x64-windows/debug/lib/boost_python-vc140-mt-gd.lib" <variant>debug ;
explicit boost_python ;
}
rule requires ( foo * )
{
}
rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * )
{
name = boost_$(name) ;
lib $(name) : $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ;
boost-install $(name) ;
}
use-project /boost/boost-test : build ;
build-project build ;

View File

@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,57 @@
![boosttest logo](doc/html/images/boost.test.logo.png)
# What is Boost.Test?
Boost.Test is a C++03/11/14/17 unit testing library, available on a wide range of platforms and compilers.
The library is part of [Boost](http://www.boost.org). The latest release
of the library is available from the boost web site.
Full instructions for use of this library can be accessed from
http://www.boost.org/doc/libs/release/libs/test/
# Key features
* Easy to get started with:
1. download and deflate the latest boost archive
1. create a test module with this (header version):
```
#define BOOST_TEST_MODULE your_test_module
#include <boost/test/included/unit_test.hpp>
```
1. Write your first test case:
```
BOOST_AUTO_TEST_CASE( your_test_case ) {
std::vector<int> a{1, 2};
std::vector<int> b{1, 2};
BOOST_TEST( a == b );
}
```
1. build and run
1. done
* powerful and unique test assertion macro [`BOOST_TEST`](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/testing_tools/boost_test_universal_macro.html), that understands floating points, collections, strings... and uses appropriate comparison paradigm
* self-registering test cases, organize cases in test suites, apply fixtures on test cases, suites or globally
* provide assertion [context](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/test_output/test_tools_support_for_logging/contexts.html) for advanced diagnostic on failure
* powerful and extensible [dataset](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation.html) tests
* add [decoration](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/decorators.html) to test cases and suites for [advanced description](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/semantic.html), [group/label](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/tests_grouping.html), and [dependencies](http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/tests_dependencies.html)
* powerful command line options and test case filters
* extensible logging, XML and JUNIT outputs for third-party tools (eg. cont. integration)
* various usage (shared/static library/header only) for faster integration and/or compilation/build cycles, smaller binaries
# Copyright and license
Copyright 2001-2014, Gennadiy Rozental.<br/>
Copyright 2013-2020, Boost.Test team.
Distributed under the Boost Software License, Version 1.0.<br/>
(Get a copy at www.boost.org/LICENSE_1_0.txt)
# Contribute
Please read [this document](CONTRIBUTE.md) to get started.
# Build Status
Boost.Test uses mostly the facility provided by our wonderful Boost testers (column `Tests` below).
Branch | Deps | Docs | Tests |
:-------------: | ---- | ---- | ----- |
[`master`](https://github.com/boostorg/test/tree/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/test.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/test.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/test.html)
[`develop`](https://github.com/boostorg/test/tree/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/test.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/test.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/test.html)

View File

@@ -0,0 +1,131 @@
# Copyright 2014, Raffi Enficiaud
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org/libs/test for the library home page.
cmake_minimum_required(VERSION 2.8.11)
project(BoostTest)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_MACOSX_RPATH ON)
add_definitions(-DBOOST_TEST_NO_LIB)
# build type, by default to release (with optimisations)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
if(NOT WITHOUT_TESTS)
# ctest sets BUILD_TESTING automatically, but does not seem to serve its purpose.
include(CTest)
enable_testing()
endif()
include(CheckCXXCompilerFlag)
include(CheckIncludeFileCXX)
if(NOT MSVC)
# c++11 options
check_cxx_compiler_flag(-std=c++11 HAS_CXX11_FLAG)
check_cxx_compiler_flag(-std=c++0x HAS_CXX0X_FLAG)
if(HAS_CXX11_FLAG)
message(STATUS "Compiling with C++11 support")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(HAS_CXX0X_FLAG)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
endif()
if(MSVC)
add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
set(MSVC_Additional_flags "/fp:fast /GF /Oy /GT /Ox /Ob2 /Oi /Os")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_Additional_flags}")
endif()
# global path
set(BOOST_TEST_ROOT_DIR ${BoostTest_SOURCE_DIR}/..)
set(BOOST_ROOT_DIR ${BOOST_TEST_ROOT_DIR}/../..)
get_filename_component(BOOST_TEST_ROOT_DIR_ABS ${BoostTest_SOURCE_DIR}/.. ABSOLUTE)
get_filename_component(BOOST_ROOT_DIR_ABS ${BOOST_ROOT_DIR} ABSOLUTE)
# include globs
file(GLOB_RECURSE
BOOST_UTF_HEADERS
${BOOST_TEST_ROOT_DIR}/include/*.hpp
${BOOST_TEST_ROOT_DIR}/include/*.ipp)
# organize files
foreach(_h IN LISTS BOOST_UTF_HEADERS)
get_filename_component(_hh ${_h} ABSOLUTE)
file(RELATIVE_PATH _v ${BOOST_TEST_ROOT_DIR_ABS}/include/boost/test ${_hh})
get_filename_component(_v "${_v}" DIRECTORY)
string(REPLACE "/" "\\" _v "${_v}")
source_group(${_v} FILES ${_h})
endforeach()
set(BOOST_UTF_SRC
${BOOST_TEST_ROOT_DIR}/src/compiler_log_formatter.cpp
${BOOST_TEST_ROOT_DIR}/src/debug.cpp
${BOOST_TEST_ROOT_DIR}/src/decorator.cpp
${BOOST_TEST_ROOT_DIR}/src/execution_monitor.cpp
${BOOST_TEST_ROOT_DIR}/src/framework.cpp
${BOOST_TEST_ROOT_DIR}/src/junit_log_formatter.cpp
${BOOST_TEST_ROOT_DIR}/src/plain_report_formatter.cpp
${BOOST_TEST_ROOT_DIR}/src/progress_monitor.cpp
${BOOST_TEST_ROOT_DIR}/src/results_collector.cpp
${BOOST_TEST_ROOT_DIR}/src/results_reporter.cpp
${BOOST_TEST_ROOT_DIR}/src/test_framework_init_observer.cpp
${BOOST_TEST_ROOT_DIR}/src/test_tools.cpp
${BOOST_TEST_ROOT_DIR}/src/test_tree.cpp
${BOOST_TEST_ROOT_DIR}/src/unit_test_log.cpp
${BOOST_TEST_ROOT_DIR}/src/unit_test_main.cpp
${BOOST_TEST_ROOT_DIR}/src/unit_test_monitor.cpp
${BOOST_TEST_ROOT_DIR}/src/unit_test_parameters.cpp
${BOOST_TEST_ROOT_DIR}/src/xml_log_formatter.cpp
${BOOST_TEST_ROOT_DIR}/src/xml_report_formatter.cpp
)
add_library(boost_test_framework
STATIC
${BOOST_UTF_HEADERS}
${BOOST_UTF_SRC})
#target_compile_definitions(boost_test_framework PUBLIC "-DBOOST_TEST_DYN_LINK=0")
target_include_directories(boost_test_framework
PUBLIC
${BOOST_TEST_ROOT_DIR}/include/
${BOOST_ROOT_DIR_ABS}/)
set_target_properties(boost_test_framework PROPERTIES FOLDER "UTF")
add_library(boost_test_framework_shared
SHARED
${BOOST_UTF_HEADERS}
${BOOST_UTF_SRC})
target_compile_definitions(boost_test_framework_shared PUBLIC "-DBOOST_TEST_DYN_LINK=1")
target_include_directories(boost_test_framework_shared
PUBLIC
${BOOST_TEST_ROOT_DIR}/include/
${BOOST_ROOT_DIR_ABS}/)
set_target_properties(boost_test_framework_shared PROPERTIES FOLDER "UTF")
####
# Documentation files (files only, no target)
file(GLOB_RECURSE
BOOST_UTF_DOC_FILES
${BOOST_TEST_ROOT_DIR}/doc/*.qbk)
add_custom_target(
quickbook
SOURCES ${BOOST_UTF_DOC_FILES})
set_property(TARGET quickbook PROPERTY FOLDER "Documentation/")
# Unit tests
add_subdirectory(${BOOST_TEST_ROOT_DIR}/test tmp_folders_tests)

View File

@@ -0,0 +1,119 @@
# (C) Copyright boost 2004-2014.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org/libs/test for the library home page.
import os ;
import ../predef/check/predef
: check
: predef-check ;
project boost/test
: source-location ../src
: requirements <link>shared:<define>BOOST_TEST_DYN_LINK=1
<toolset>borland:<cxxflags>-w-8080
<target-os>cygwin:<define>_POSIX_C_SOURCE=200112L
# Disable Warning about boost::noncopyable not being exported
<link>shared,<toolset>msvc:<cxxflags>-wd4275
<toolset>msvc:<cxxflags>-wd4671
<toolset>msvc:<cxxflags>-wd4673
[ predef-check "BOOST_COMP_GNUC >= 4.3.0" : : <cxxflags>-Wno-variadic-macros ]
<toolset>clang:<cxxflags>-Wno-c99-extensions
<toolset>clang:<cxxflags>-Wno-variadic-macros
<warnings>all
# <warnings-as-errors>on
: usage-requirements
<define>BOOST_TEST_NO_AUTO_LINK=1
# Disable Warning about boost::noncopyable not being exported
<link>shared,<toolset>msvc:<cxxflags>-wd4275
;
PRG_EXEC_MON_SOURCES =
execution_monitor
debug
cpp_main
;
TEST_EXEC_MON_SOURCES =
compiler_log_formatter
debug
decorator
execution_monitor
framework
plain_report_formatter
progress_monitor
results_collector
results_reporter
test_framework_init_observer
test_main
test_tools
test_tree
unit_test_log
unit_test_main
unit_test_monitor
unit_test_parameters
junit_log_formatter
xml_log_formatter
xml_report_formatter
;
UTF_SOURCES =
compiler_log_formatter
debug
decorator
execution_monitor
framework
plain_report_formatter
progress_monitor
results_collector
results_reporter
test_framework_init_observer
test_tools
test_tree
unit_test_log
unit_test_main
unit_test_monitor
unit_test_parameters
junit_log_formatter
xml_log_formatter
xml_report_formatter
;
lib boost_prg_exec_monitor
: # sources
$(PRG_EXEC_MON_SOURCES).cpp
: # requirements
: # default build
: # usage-requirements
<link>shared:<define>BOOST_TEST_DYN_LINK=1
;
lib boost_test_exec_monitor
: # sources
$(TEST_EXEC_MON_SOURCES).cpp
: # requirements
<link>static
: # default build
: # usage-requirements
<link>shared:<define>BOOST_TEST_DYN_LINK=1
;
lib boost_unit_test_framework
: # sources
$(UTF_SOURCES).cpp
: # requirements
: # default build
: # usage-requirements
<link>shared:<define>BOOST_TEST_DYN_LINK=1
;
alias minimal ;
alias included ;
boost-install boost_prg_exec_monitor
boost_test_exec_monitor
boost_unit_test_framework ;

View File

@@ -0,0 +1,154 @@
#
# Copyright (c) 2003 Boost.Test contributors
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
using quickbook ;
using doxygen ;
using boostbook ;
########################################################################
# Standalone HTML documentation
import doxygen ;
doxygen doxygen_reference_generated_doc
:
$(BOOST_ROOT)/libs/test/include/boost/test/debug_config.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/detail/global_typedef.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/debug.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/execution_monitor.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/framework.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/tools/assertion_result.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/unit_test.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/tree/observer.hpp
# logs and formatters
$(BOOST_ROOT)/libs/test/include/boost/test/unit_test_log.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/output/xml_log_formatter.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/output/plain_report_formatter.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/output/compiler_log_formatter.hpp
# reports
$(BOOST_ROOT)/libs/test/include/boost/test/output/xml_report_formatter.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/unit_test_log_formatter.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/results_reporter.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/results_collector.hpp
# progress monitor
$(BOOST_ROOT)/libs/test/include/boost/test/progress_monitor.hpp
# test cases and suites
$(BOOST_ROOT)/libs/test/include/boost/test/tree/test_unit.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/parameterized_test.hpp
# execution monitor source files
$(BOOST_ROOT)/libs/test/include/boost/test/execution_monitor.hpp
# output test stream
$(BOOST_ROOT)/libs/test/include/boost/test/tools/output_test_stream.hpp
# datasets
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/fwd.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/test_case.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/for_each_sample.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/size.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/delayed.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/initializer_list.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/array.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/collection.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generate.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/grid.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/join.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/singleton.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/zip.hpp
# datasets generators
$(BOOST_ROOT)/libs/test/include/boost/test/data/config.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/keywords.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/random.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/data/monomorphic/generators/xrange.hpp
# utils
$(BOOST_ROOT)/libs/test/include/boost/test/utils/algorithm.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/utils/named_params.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/tools/floating_point_comparison.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/utils/is_forward_iterable.hpp
# BOOST_TEST related functions
$(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/bitwise_manip.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/lexicographic_manip.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/per_element_manip.hpp
$(BOOST_ROOT)/libs/test/include/boost/test/tools/detail/tolerance_manip.hpp
# others
$(BOOST_ROOT)/libs/test/include/boost/test/unit_test_parameters.hpp
:
<doxygen:param>EXTRACT_ALL=YES
<doxygen:param>"PREDEFINED=\"BOOST_TEST_DECL=\" \\
\"BOOST_TEST_DOXYGEN_DOC__=1\"
"
<doxygen:param>HIDE_UNDOC_MEMBERS=NO
<doxygen:param>AUTOLINK_SUPPORT=YES
<doxygen:param>HIDE_UNDOC_CLASSES=NO
<doxygen:param>INLINE_INHERITED_MEMB=YES
<doxygen:param>EXTRACT_PRIVATE=NO
<doxygen:param>ENABLE_PREPROCESSING=YES
<doxygen:param>MACRO_EXPANSION=YES
<doxygen:param>EXPAND_ONLY_PREDEF=YES
<doxygen:param>SEARCH_INCLUDES=YES
<doxygen:param>INCLUDE_PATH=$(BOOST_ROOT)/libs/test/include
<doxygen:param>EXAMPLE_PATH=$(BOOST_ROOT)/libs/test/doc/examples
<doxygen:param>BRIEF_MEMBER_DESC=YES
<doxygen:param>REPEAT_BRIEF=YES
<doxygen:param>ALWAYS_DETAILED_SEC=YES
<doxygen:param>MULTILINE_CPP_IS_BRIEF=YES
<doxygen:param>CASE_SENSE_NAMES=YES
<doxygen:param>INTERNAL_DOCS=NO
<doxygen:param>SUBGROUPING=YES
<doxygen:param>SHORT_NAMES=YES
;
########################################################################
# HTML documentation for $(BOOST_ROOT)/doc/html
xml test_doc
:
test.qbk
;
explicit test_doc ;
path-constant images_location : html ;
boostbook standalone
:
test_doc
:
<xsl:param>boost.root=../../../..
<xsl:param>html.stylesheet=boostbook.css
<xsl:param>chapter.autolabel=0
<xsl:param>toc.max.depth=3
<xsl:param>toc.section.depth=10
<xsl:param>chunk.section.depth=4
<xsl:param>chunk.first.sections=1
<xsl:param>generate.section.toc.level=3
<format>pdf:<xsl:param>img.src.path=$(images_location)/
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/test/doc/html
<dependency>doxygen_reference_generated_doc
;
explicit test ;
###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : standalone ;
explicit boostrelease ;

View File

@@ -0,0 +1,71 @@
This folder contains the documentation for the Boost.Test library.
Any contribution or submission to the library should be accompanied by the corresponding documentation.
The format of the documentation uses [Quickbook](http://www.boost.org/tools/quickbook/index.html).
How to build the documentation
==============================
In order to generate the documentation, the following is needed:
* Docbook
* Doxygen
* xsltproc
Doxygen
-------
Part of the documentation needs [Doxygen](http://www.doxygen.org). `doxygen` should be accessible from the `PATH`.
Docbook
-------
Quickbook needs Docbook (XSL and XML) to be installed. Download and untar the docbook archives:
* Docbook XSL that can be found here: http://sourceforge.net/projects/docbook/files/docbook-xsl/
* Docbook DTD that can be found here: http://www.docbook.org/schemas/
The directories `$docbook_xsl_directory` and `$docbook_dtd_directory`, respectively, will refer to the location
of the deflated archive.
Download xsltproc
-----------------
This program is needed by Docbook, in order to be able to transform XMLs into HTMLs.
`xsltproc` should be accessible from the `PATH`.
**note**: `xsltproc` seems to be distributed with macOS.
Construct b2
------------
Simply by typing in a console at the root of the Boost repository:
```
> ./bootstrap.[sh|bat]
```
Build the documentation
-----------------------
Running the following commands will construct the documentation with `b2` and
all the needed dependencies:
```
> cd $boost_root/libs/test/doc
> ../../../b2 -sDOCBOOK_XSL_DIR=$docbook_xsl_directory -sDOCBOOK_DTD_DIR=$docbook_dtd_directory
```
It is possible to run directly
```
> ../../../b2
```
but this results in a download from the Internet of the Docbook XLS and DTD, which is much slower.
Recommendations
===============
- Documentation is part of the "definition of done". A feature does not exist until it is implemented, tested, documented and reviewed.
- It is highly recommended that each of your pull request comes with an updated documentation. Not doing so put this work on the shoulders
of the maintainers and as a result, it would be likely that the pull request is not addressed in a timely manner.
- Please also update the changelog in the file [`change_log.qbk`](closing_chapters/change_log.qbk)
indicating your contribution
- Every file should come with a copyright notice at their very beginning

View File

@@ -0,0 +1,52 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[/ ##################################################################### ]
[section:adv_scenarios Advanced Usage Scenarios]
If you are reading this chapter, this means that the wide range of tools and interfaces covered
in the previous sections are not sufficient for the testing scenario
you have in mind. You are here to bend the __UTF__ to your will and ... we are not going to
stop you. Instead we'll try to guide you so that some dark corners do not look scary.
In most cases the __UTF__ is going to be supplied for you either as part of your system libraries
or set of libraries used by your companies. Yet if you are facing the necessity to build your
own static or dynamic library of the __UTF__ or need to customize the build for any reason, section
[link boost_test.adv_scenarios.build_utf Building the __UTF__] covers all the necessary steps.
To streamline the experience of setting up your test module, the __UTF__ provides some default
initialization logic for them. Usually the default test module initialization will work just fine,
but if you want to implement some custom initialization or change how default initialization
behaves you need to first look in [*Test module initialization] section. Here you'll learn
about various options the __UTF__ provides for you to customize this behavior.
The part of the framework which loads, initializes and executed your test module is called the
[*Test Runner]. Each usage variant comes with default test runner. If, instead, you prefer to
implement your own entry point into the test module (for example if you need to implement the
`main` function yourself and not use the one provided by the __UTF__, you need to learn about
__UTF__ interfaces involved in test runners operations. These are covered in the [*Test runners]
section. Let me reiterate that you only need to this section if regular regular options for
customization of initialization logic like
[link boost_test.tests_organization.fixtures fixtures] or [link boost_test.tests_organization.decorators decorators]
are not sufficient for your purposes.
[/ build and link with boost.test]
[include adv_scenarios/building_utf.qbk]
[include adv_scenarios/entry_point_overview.qbk]
[include adv_scenarios/test_module_init_overview.qbk]
[include adv_scenarios/test_module_runner_overview.qbk]
[include adv_scenarios/single_header_customizations.qbk]
[include adv_scenarios/static_lib_customizations.qbk]
[include adv_scenarios/shared_lib_customizations.qbk]
[include adv_scenarios/external_test_runner.qbk]
[include adv_scenarios/obsolete_init_func.qbk]
[/=============================================================================]
[endsect] [/Advanced usage scenarios]
[/ EOF]

View File

@@ -0,0 +1,65 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:build_utf Building the __UTF__]
In case you would like to use the [link boost_test.usage_variants.shared_lib shared library variant] or the [link boost_test.usage_variants.static_lib static library variant] of the __UTF__, the library needs to be built.
Building the __UTF__ is in fact quite easy.
In the sequel, we define
* $`boost_path` refers to the location where the boost archive was deflated
* $`boost_installation_prefix` refers to the location where you want to install the __UTF__
[/ not true
[note By default, the static and dynamic variant will be built for your operating system]
]
More documentation about *Boost's build system* can be found [@http://www.boost.org/more/getting_started/index.html here].
[h3 Windows]
You need to have a compilation toolchain. /Visual Studio Express/ is such one, freely available from the
Microsoft website. Once installed, open a /Visual Studio Command Line tools/ prompt and build the Boost build program `b2`
(see the link above). You will then be able to compile the __UTF__ with different variants.
[h4 Static variant]
For building 32bits libraries, open a console window and enter the following commands:
```
> cd ``$``boost_path
> bootstrap.bat
> b2 address-model=32 architecture=x86 --with-test link=static \
> --prefix=``$``boost_installation_prefix install
```
For building 64bits libraries, the commands become:
```
> cd ``$``boost_path
> bootstrap.bat
> b2 address-model=64 architecture=x86 --with-test link=static \
> --prefix=``$``boost_installation_prefix install
```
[h4 Shared library variant]
In order to build the shared library variant, the directive `link=static` should be replaced by `link=shared` on the above command lines.
For instance, for 64bits builds, the commands become:
```
> cd ``$``boost_path
> bootstrap.bat
> b2 address-model=64 architecture=x86 --with-test link=shared --prefix=``$``boost_installation_prefix install
```
[h3 Linux/OSX]
For Unix/Linux/OSX operating system, the build of the __UTF__ is very similar to the one on Windows:
```
> cd ``$``boost_path
> ./bootstrap.sh
> ./b2 --with-test --prefix=``$``boost_installation_prefix install
```
[endsect] [/build_utf]

View File

@@ -0,0 +1,39 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:entry_point_overview Test module's entry point]
Typically, every C++ program contains exactly one definition of function `main`: the program's /entry point/.
When using the __UTF__ you do not have to define one. Function `main` will be generated for you by the framework.
The only thing you are required to do in case your program consists of more than one translation unit (`cpp` file)
is to indicate to the framework in which of the files it is supposed to generate function `main`.
You do it by defining macro __BOOST_TEST_MODULE__ before the inclusion of any of the framework files.
The value of this macro is used as a name of the [link ref_test_module test module] as well as the
[link boost_test.tests_organization.test_tree.master_test_suite master test suite].
The reason for defining function `main` for you is twofold:
# This allows the __UTF__ to perform some custom [link boost_test.adv_scenarios.test_module_init_overview ['test module initialization]].
# This prevents you defining `main`, and accidentally forgetting to run all the test (in which case running the program would incorrectly indicate a clean run).
By default, the test module's entry point is defined with signature:
```
int main(int argc, char* argv[]);
```
It calls [link boost_test.adv_scenarios.test_module_init_overview ['test module initialization]] function, then calls the
[link boost_test.adv_scenarios.test_module_runner_overview ['test module runner]] and forwards its return value to environment.
The default entry point is sufficient in most of the cases. Occasionally, a need may arise to declare an entry point with a
different name or signature. For overriding the definition of the default test module's entry point:
* [link boost_test.adv_scenarios.single_header_customizations.entry_point see here], for header-only usage variant,
* [link boost_test.adv_scenarios.static_lib_customizations.entry_point see here], for static library usage variant,
* [link boost_test.adv_scenarios.shared_lib_customizations.entry_point see here], for shared library usage variant.
[endsect] [/section:entry_point_overview]

View File

@@ -0,0 +1,23 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:external_test_runner The external test runner usage variant]
This usage variant does not provide any [link boost_test.adv_scenarios.test_module_runner_overview test runner].
You employ it when you only want to define a [link ref_test_tree test tree] and possibly an
[link boost_test.adv_scenarios.test_module_init_overview initialization function],
and expect another (external) program to evaluate these tests. This external program will come with its own test runner.
If you plan to use an external test runner with your test module, you need to build it as a dynamic library.
You need to define macro flag __BOOST_TEST_DYN_LINK__ either in a makefile or before the header
`boost/test/unit_test.hpp` inclusion. An external test runner utility is required to link with dynamic library.
The __UTF__ comes with an example external test runner `console_test_runner`:
Given a name of the test module (implemented as a shared library), and a name of the initialization function defined therein,
the program can run all the tests from the module's test tree.
[endsect] [/section:external_test_runner]

View File

@@ -0,0 +1,134 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:link_references Build scenarios and behaviors]
[/-----------------------------------------------------------------]
[section:link_boost_test_main_macro `BOOST_TEST_MAIN`]
When defined, this macro creates a stub for the test module initialization (the main entry part). This
macro also expands properly into a `main` function in case the shared library variant of the __UTF__ is used.
[caution This macro should
# be defined before any inclusion directive to __UTF__ headers
# be defined exactly for one compilation unit of your test module
]
[tip The macro __BOOST_TEST_MODULE__ should be preferred]
[endsect]
[/-----------------------------------------------------------------]
[section:link_boost_test_module_macro `BOOST_TEST_MODULE`]
Serves the same purpose as the macro __BOOST_TEST_MAIN__ but, in addition, defines the name of the master test suite.
[caution As __BOOST_TEST_MAIN__, this macro should
# be defined before any inclusion directive to __UTF__ headers
# be defined exactly for one compilation unit of your test module
]
An example may be found [link ref_BOOST_TEST_MODULE here].
[endsect]
[/-----------------------------------------------------------------]
[section:link_boost_test_alternative_init_macro `BOOST_TEST_ALTERNATIVE_INIT_API`]
[warning This macro should be defined before any include directive to the __UTF__ headers and is
mutually exclusive with the __BOOST_TEST_MODULE__ macro.]
In case of custom initialization of the test module entry point, this macro indicates the __UTF__ to
use the new API. The differences between the new and old APIs are described in [link
boost_test.adv_scenarios.obsolete_init_func this section].
The way to customize the entry point of the test-module depends on the variant of the __UTF__ in use.
Several sections in the documentation are devoted to this:
* [link boost_test.adv_scenarios.single_header_customizations.entry_point this section] for single header variant,
* [link boost_test.adv_scenarios.static_lib_customizations.init_func this section] for static link variant,
* [link boost_test.adv_scenarios.shared_lib_customizations.init_func this section] for shared link variant
[endsect]
[/-----------------------------------------------------------------]
[section:link_boost_test_no_lib `BOOST_TEST_NO_LIB`]
Define this flag to prevent auto-linking.
[note The same flag is used for the __UTF__ and the __PEM__ components.]
[endsect]
[/-----------------------------------------------------------------]
[section:link_boost_test_dyn_link `BOOST_TEST_DYN_LINK`]
Define this flag to link against the __UTF__ shared library.
[note The same flag is used for the __UTF__ and the __PEM__ components.]
[endsect]
[/-----------------------------------------------------------------]
[section:link_boost_test_no_main `BOOST_TEST_NO_MAIN`]
Prevents the auto generation of the test module initialization functions. This macro is particularly relevant for
manually registered tests in conjunction with dynamic variant of the __UTF__. When defined, a `main` function
registering all the tests should be implemented.
An example of a module initialization would be
``
#define __BOOST_TEST_NO_MAIN__
#include <boost/test/unit_test.hpp>
// a function in another compilation unit registering tests under the master test suite.
void register_some_tests_manually(test_suite* test);
bool registering_all_tests()
{
test_suite* test_master_suite = &boost::unit_test::framework::master_test_suite();
register_some_tests_manually(test_master_suite);
// register any other tests function or test suite to the master test suite
// ...
return true;
}
int main(int argc, char* argv[])
{
return ::boost::unit_test::unit_test_main(&registering_all_tests, argc, argv);
}
``
[endsect]
[/-----------------------------------------------------------------]
[section:link_boost_test_global_configuration `BOOST_TEST_GLOBAL_CONFIGURATION`]
Declares a class that will be constructed during the initialization of the test framework, and destructed afterwards.
The framework will not call any other member function than the constructor and destructor.
In particular the constructor and destructor will be called prior and after to the [link boost_test.tests_organization.fixtures.global global fixtures]
setup and teardown.
This facility is provided to perform additional configuration, in particular programmatic configuration
of the loggers and reporters. See [link boost_test.test_output.logging_api this section] for more details.
[warning No logging or any other call to the framework assertion is allowed in the constructor and destructor, as its purpose is
to set-up the loggers/reporters, and the assertions are calling the logging/reporting facility.
Any such assertion during the execution of the will result in the abortion of the test module .]
[endsect]
[/-----------------------------------------------------------------]
[section:config_disable_alt_stack `BOOST_TEST_DISABLE_ALT_STACK`]
Disables the support of the alternative stack.
Define this macro before the inclusion of any __UTF__ header to disable the support
of the [@http://www.gnu.org/software/libc/manual/html_node/Signal-Stack.html alternative stack],
in case your compiler does not support it and the __UTF__ cannot automatically guess the lack of support.
See [link boost_test.utf_reference.rt_param_reference.use_alt_stack `use_alt_stack`]
and [macroref BOOST_TEST_DISABLE_ALT_STACK `BOOST_TEST_DISABLE_ALT_STACK`] for more details.
[endsect]
[endsect]

View File

@@ -0,0 +1,46 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:obsolete_init_func The obsolete initialization function]
For backwards compatibility, the __UTF__ also allows the customization of an initialization function of a different type.
This is called the ['obsolete initialization function]. Its signature is:
```
boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]);
```
The original design of the __UTF__ required of the programmer to implement it. It was intended to initialize and return
the __master_test_suite__. No [link ref_BOOST_AUTO_TEST_CASE automatic test case registration] was available at that
time. The null-pointer value was considered an initialization error.
In the header-only usage variant, you fall back to the obsolete initialization function signature by omitting the
definition of macro __BOOST_TEST_ALTERNATIVE_INIT_API__ in test module code.
[bt_example custom_obsolete_init..using obsolete initialization function..run-fail]
In the static-library usage variant, you need to omit the definition of macro __BOOST_TEST_ALTERNATIVE_INIT_API__ in test
module and compile the __UTF__ static library without the compilation flag __BOOST_TEST_ALTERNATIVE_INIT_API__ (this is
the default).
In the shared-library usage variant, it is not possible to use the obsolete initialization function.
Even if you decide to us the obsolete initialization function, it is recommended that:
# You always return a null-pointer value and install the master test suite via
[memberref boost::unit_test::test_suite::add `test_suite::add`] as illustrated
[link ref_BOOST_TEST_CASE here]. The current framework does no longer treat the
null-pointer value as failure.
# You signal the failure by throwing [classref boost::unit_test::framework::setup_error] exception.
# You access the command-line arguments through the interface of the __master_test_suite__,
and ignore the function's arguments `argc` and `argv`.
[caution The obsolete initialization function is deprecated as its name indicates. It is recommended to migrate
to the new API, and rely on the automated test unit registration and [link boost_test.tests_organization.fixtures
fixtures] (including [link boost_test.tests_organization.fixtures.global global fixtures]) for other set-up. ]
[endsect] [/section:obsolete_init_func]

View File

@@ -0,0 +1,104 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:shared_lib_customizations Shared-library variant customizations]
[caution Macro __BOOST_TEST_DYN_LINK__ (which instructs the compiler/linker to dynamically link against a shared
library variant) may be implicitly defined when macro `BOOST_ALL_DYN_LINK` is defined.]
[caution In order to be able to run a test built with the dynamic variant, the operating system should be able
to find the dynamic library of the __UTF__. This means, for example on Linux and MacOSX respectively, setting the environment
variable `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` properly prior to the execution of the test module.]
[section:entry_point Customizing the module's entry point]
In this variant, in one of the source files, you now have to define your custom entry point, and invoke the default
[link boost_test.adv_scenarios.test_module_runner_overview test runner] `unit_test_main` manually with the default
[link boost_test.adv_scenarios.test_module_init_overview initialization function] `init_unit_test` as argument.
You need to define __BOOST_TEST_NO_MAIN__ (its value is irrelevant) in the main file:
[table
[[In *exactly one* file][In all other files]]
[[```#define BOOST_TEST_MODULE test module name
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
// entry point:
int main(int argc, char* argv[], char* envp[])
{
return boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
}
```]
[```#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
//
// test cases
//
//
// test cases
//
```]]
]
[endsect] [/section:entry_point]
[section:init_func Customizing the module's initialization function]
In the shared-library variant, it is impossible to customize the initialization function without
[link boost_test.adv_scenarios.shared_lib_customizations.entry_point customizing the entry point]. We have
to customize both. In one of the source files, you now have to define your custom entry point and
[link boost_test.adv_scenarios.test_module_init_overview initialization function] `init_unit_test`; next invoke
the default [link boost_test.adv_scenarios.test_module_runner_overview test runner] `unit_test_main` manually
with `init_unit_test` as argument. You ['do not] define __BOOST_TEST_MODULE__ in the main file:
[table
[[In *exactly one* file][In all other files]]
[[```#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
// initialization function:
bool init_unit_test()
{
return true;
}
// entry point:
int main(int argc, char* argv[])
{
return boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
}
```]
[```#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
//
// test cases
//
//
// test cases
//
//
// test cases
//
```]]
]
For reporting errors that may occur during the initialization,
* either you return `false` (valid only for the new API only, see __BOOST_TEST_ALTERNATIVE_INIT_API__)
* or you raise an exception such as `std::runtime_error` or [classref boost::unit_test::framework::setup_error]
An error reported in this function aborts the execution of the test module.
[endsect] [/section:init_func]
[endsect] [/section:shared_lib_customizations]

View File

@@ -0,0 +1,93 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:single_header_customizations Header-only variant customizations]
[section:multiple_translation_units Header-only with multiple translation units]
It is possible to use the header-only variant of the __UTF__ even if the test module has multiple translation
units:
* one translation unit should define __BOOST_TEST_MODULE__ and include `<boost/test/included/unit_test.hpp>`
* all the other translation units should include `<boost/test/unit_test.hpp>`
An example might be the following:
* Translation unit 1, defines __BOOST_TEST_MODULE__
```
#define BOOST_TEST_MODULE header-only multiunit test
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test1 )
{
int i = 1;
BOOST_CHECK( i*i == 1 );
}
```
* Translation unit 2, includes `<boost/test/unit_test.hpp>` instead of `<boost/test/included/unit_test.hpp>`:
```
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test2 )
{
int i = 1;
BOOST_CHECK( i*i == 1 );
}
```
[endsect] [/section:multiple_translation_units]
[section:entry_point Customizing the module's entry point]
In this usage variant and in the translation unit containing the definition of __BOOST_TEST_MODULE__,
you need to define the macros __BOOST_TEST_NO_MAIN__ and
__BOOST_TEST_ALTERNATIVE_INIT_API__ (their values are irrelevant) prior to including any of the framework's headers.
Next, you have to define your custom entry point, and invoke the default [link
boost_test.adv_scenarios.test_module_runner_overview test runner] `unit_test_main` manually with the default [link
boost_test.adv_scenarios.test_module_init_overview initialization function] `init_unit_test` as argument.
[bt_example custom_main..using custom entry point..run-fail]
In the above example, a custom entry point was selected because the test module, in addition to command line arguments,
needs to obtain also the information about environment variables.
[note The above example also illustrates that it makes sense to define both __BOOST_TEST_MODULE__ and
__BOOST_TEST_NO_MAIN__. This way, no `main` is generated by the framework, but the name specified by __BOOST_TEST_MODULE__
is assigned to the [link boost_test.tests_organization.test_tree.master_test_suite Master test suite].]
[note The reason for defining __BOOST_TEST_ALTERNATIVE_INIT_API__ is described [link
boost_test.adv_scenarios.obsolete_init_func here].]
[endsect] [/section:entry_point]
[section:init_func Customizing the module's initialization function]
In this usage variant, you do not define macro __BOOST_TEST_MODULE__ and instead provide the definition of function
`init_unit_test`. This is going to be the custom initialization function. The default [link
boost_test.adv_scenarios.test_module_runner_overview test runner] will use it to initialize the test module.
[bt_example custom_init..using custom initialization function..run-fail]
[note Because we overwrote the default initialization function, it does no longer assign any name to the [link
boost_test.tests_organization.test_tree.master_test_suite master test suite]. Therefore the default name ("Master Test
Suite") is used.]
For reporting errors that may occur during the initialization,
* either you return `false` (valid only for the new API only, see __BOOST_TEST_ALTERNATIVE_INIT_API__)
* or you raise an exception such as `std::runtime_error` or [classref boost::unit_test::framework::setup_error]
An error reported in this function aborts the execution of the test module.
[note The reason for defining __BOOST_TEST_ALTERNATIVE_INIT_API__ is described [link
boost_test.adv_scenarios.obsolete_init_func here].]
[endsect] [/section:init_func]
[endsect] [/section:single_header_customizations]

View File

@@ -0,0 +1,123 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:static_lib_customizations Static-library variant customizations]
[section:entry_point Customizing the module's entry point]
In the static library variant, customizing the main entry point is quite troublesome, because the definition
of function `main` is already compiled into the static library. This requires you to rebuild the __UTF__
static library with the defined symbol __BOOST_TEST_NO_MAIN__. In the Boost root directory you need to
invoke command
```
> b2 --with-test link=static define=__BOOST_TEST_NO_MAIN__ define=__BOOST_TEST_ALTERNATIVE_INIT_API__ install
```
[warning This removal of entry point definition from the static library will affect everybody else who is
linking against the library. It may be less intrusive to switch to the
[link boost_test.adv_scenarios.shared_lib_customizations shared library usage variant] instead.]
In one of the source files, you now have to define your custom entry point, and invoke the default
[link boost_test.adv_scenarios.test_module_runner_overview test runner] `unit_test_main` manually with
the default [link boost_test.adv_scenarios.test_module_init_overview initialization function] `init_unit_test`
as the first argument. There is no need to define __BOOST_TEST_NO_MAIN__ in your source code, but you need
to define __BOOST_TEST_ALTERNATIVE_INIT_API__ in the main file:
[table
[[In *exactly one* file][In all other files]]
[[```#define BOOST_TEST_MODULE test module name
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/test/unit_test.hpp>
// entry point:
int main(int argc, char* argv[], char* envp[])
{
return utf::unit_test_main(init_unit_test, argc, argv);
}
```]
[```#include <boost/test/unit_test.hpp>
//
// test cases
//
//
// test cases
//
```]]
]
[note The reason for defining __BOOST_TEST_ALTERNATIVE_INIT_API__ is described
[link boost_test.adv_scenarios.obsolete_init_func here].]
[endsect] [/section:entry_point]
[section:init_func Customizing the module's initialization function]
In the static library variant, customizing the main entry point is quite troublesome, because the default test
runner compiled into the static library uses the obsolete initialization function signature. This requires you
to rebuild the __UTF__ static library with the defined symbol __BOOST_TEST_ALTERNATIVE_INIT_API__. In the Boost
root directory you need to invoke command
```
> b2 --with-test link=static define=__BOOST_TEST_ALTERNATIVE_INIT_API__ install
```
[warning This alteration of the static library will affect everybody else who is linking against the
library. Consider using the [link boost_test.adv_scenarios.obsolete_init_func obsolete test initialization function],
which requires no rebuilding. Alternatively, it may be less intrusive to switch to the
[link boost_test.adv_scenarios.shared_lib_customizations shared library usage variant] instead.]
In one of the source files, you now have to define your custom initialization function with signature:
```
bool init_unit_test();
```
The default [link boost_test.adv_scenarios.test_module_runner_overview test runner] will use it to initialize
the test module. In your source code, you no longer define macro __BOOST_TEST_MODULE__; instead, you need to
define __BOOST_TEST_ALTERNATIVE_INIT_API__ in the main file:
[table
[[In *exactly one* file][In all other files]]
[[```#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/test/unit_test.hpp>
// init func:
bool init_unit_test()
{
return true;
}
```]
[```#include <boost/test/unit_test.hpp>
//
// test cases
//
// test cases
//
```]]
]
For reporting errors that may occur during the initialization,
* either you return `false` (valid only for the new API only, see __BOOST_TEST_ALTERNATIVE_INIT_API__)
* or you raise an exception such as `std::runtime_error` or [classref boost::unit_test::framework::setup_error]
An error reported in this function aborts the execution of the test module.
[note The reason for defining __BOOST_TEST_ALTERNATIVE_INIT_API__ is described
[link boost_test.adv_scenarios.obsolete_init_func here].]
[endsect] [/section:init_func]
[endsect] [/section:static_lib_customizations]

View File

@@ -0,0 +1,51 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:test_module_init_overview Test module's initialization]
In order for a unit test module to successfully link and execute, it has to have access to the ['test module's initialization
function]. the module's initialization function is called only once during the execution of the program, just before the
[link boost_test.adv_scenarios.test_module_runner_overview ['test module runner]] is run. By default, the __UTF__ provides
a default definition of initialization function. The only thing you have to do is to instruct the framework in which translation
unit (`cpp` file) it needs to provide the definition. You do it by defining macro __BOOST_TEST_MODULE__ in the designated file.
The default implementation assigns the name to the [link ref_test_module test module] as well as the
[link boost_test.tests_organization.test_tree.master_test_suite master test suite]. The name to be assigned is specified by
the value of the macro __BOOST_TEST_MODULE__.
[important
For a test module consisting of multiple source files you have to define __BOOST_TEST_MODULE__ in a single test file only.
Otherwise you end up with multiple instances of the initialization function.
]
There is practically no need to ever alter the default behavior of the test module's initialization function. The __UTF__ provides
superior tools for performing customization tasks:
* for automatic registration of test cases and test suites in the test tree, see section [link boost_test.tests_organization Tests organization];
* in order to assign the custom name to the master test suite define macro __BOOST_TEST_MODULE__ to desired value;
* in order to access the command-line parameters (except the ones consumed by the __UTF__), use the interface of the
[link boost_test.tests_organization.test_tree.master_test_suite master test suite];
* in order to perform a global initialization of the state required by the test cases, [link boost_test.tests_organization.fixtures.global global fixtures]
offer a superior alternative: you can specify global set-up and tear-down in one place, allow access to the global data from every test case, and guarantee
that clean-up and tear-down is repeated each time the tests are re-run during the execution of the program;
* if the need for custom module initialization is only driven by legacy code (written against old versions of the __UTF__), it is recommended
to update your program's code.
The default initialization function provided by the framework is defined with the following signature in the global namespace:
```
bool init_unit_test();
```
Return value `true` indicates a successful initialization. Value `false` indicates initialization failure.
For overriding the default definition:
* [link boost_test.adv_scenarios.single_header_customizations.init_func see here], for header-only usage variant,
* [link boost_test.adv_scenarios.static_lib_customizations.init_func see here], for static library usage variant,
* [link boost_test.adv_scenarios.shared_lib_customizations.init_func see here], for shared library usage variant.
[endsect] [/section:test_module_init_overview]

View File

@@ -0,0 +1,50 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:test_module_runner_overview Test module runner]
A ['test module runner] is an ['orchestrator] or a ['driver] that, given the test tree, ensures the test tree is initialized,
tests are executed and necessary reports generated. It performs the following operations:
* initialize the test module using the supplied [link boost_test.adv_scenarios.test_module_init_overview ['initialization function]];
* select output media for the test log and the test results report;
* execute test cases as specified by run-time parameters;
* produce the test results report;
* generate the appropriate return code.
The __UTF__ comes with the default test runner. There is no need to call it explicitly. The default generated test module's
[link boost_test.adv_scenarios.entry_point_overview entry point] invokes the default test runner. The default test runner is
declared with the following signature:
```
namespace boost { namespace unit_test {
typedef bool (*init_unit_test_func)();
int unit_test_main( init_unit_test_func init_func, int argc, char* argv[] );
} }
```
The test runner may return one of the following values:
[table
[[Value][Meaning]]
[[`boost::exit_success`][
* No errors occurred during testing, or
* the success result was forced with command-line argument `--[link boost_test.utf_reference.rt_param_reference.result_code `result_code`]=no`.]]
[[`boost::exit_test_failure`][
* Non-fatal errors detected and no uncaught exceptions were thrown during testing, or
* the initialization of the __UTF__ failed. ]]
[[`boost::exit_exception_failure`][
* Fatal errors were detected, or
* uncaught exceptions thrown during testing. ]]
]
An advanced test runner may provide additional features, including interactive GUI interfaces, test coverage and profiling support.
[endsect] [/section:test_module_runner_overview]

View File

@@ -0,0 +1,28 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section Acknowledgements]
[h4 Boost Test Team]
Boost.Test 3.0 is being developed and maintained by Gennadiy Rozental and Raffi Enficiaud.
[h4 New documentation]
Raffi Enficiaud and Andrzej Krzemienski efforts were a driving force behind the Boost.Test documentation overhaul.
[h4 Second incarnation including the Unit Test Framework]
Beman Dawes and Ullrich Koethe started the library. Fernando Cacciola, Jeremy Siek, Beman Dawes, Ullrich Koethe,
Dave Abrahams suggested numerous improvements during the Formal Review. Jeremy Siek was the review manager. Beman
Dawes was a great help in both final testing and merging library with rest of the boost. Gennadiy Rozental was the
developer and maintainer.
[h4 Original Test Library]
Ed Brey, Kevlin Henney, Ullrich Koethe, and Thomas Matelich provided very helpful comments during development.
Dave Abrahams, Ed Brey, William Kempf, Jens Maurer, and Wilka suggested numerous improvements during the Formal
Review. Jens Maurer was the review manager. Beman Dawes is the developer and maintainer.
[endsect]

View File

@@ -0,0 +1,611 @@
[/
/ Copyright (c) 2013 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section Change log]
Boost.Test releases:
* [link ref_CHANGE_LOG_3_15 Boost.Test v3.15 / boost 1.79]
* [link ref_CHANGE_LOG_3_14 Boost.Test v3.14 / boost 1.74]
* [link ref_CHANGE_LOG_3_13 Boost.Test v3.13 / boost 1.73]
* [link ref_CHANGE_LOG_3_12 Boost.Test v3.12 / boost 1.72]
* [link ref_CHANGE_LOG_3_11 Boost.Test v3.11 / boost 1.71]
* [link ref_CHANGE_LOG_3_10 Boost.Test v3.10 / boost 1.70]
* [link ref_CHANGE_LOG_3_9 Boost.Test v3.9 / boost 1.69]
* [link ref_CHANGE_LOG_3_8 Boost.Test v3.8 / boost 1.68]
* [link ref_CHANGE_LOG_3_7 Boost.Test v3.7 / boost 1.67]
* [link ref_CHANGE_LOG_3_6 Boost.Test v3.6 / boost 1.65]
* [link ref_CHANGE_LOG_3_5 Boost.Test v3.5 / boost 1.64]
* [link ref_CHANGE_LOG_3_4 Boost.Test v3.4 / boost 1.63]
* [link ref_CHANGE_LOG_3_3 Boost.Test v3.3 / boost 1.62]
* [link ref_CHANGE_LOG_3_2 Boost.Test v3.2 / boost 1.61]
* [link ref_CHANGE_LOG_3_1 Boost.Test v3.1 / boost 1.60]
* [link ref_CHANGE_LOG_3_0 Boost.Test v3 / boost 1.59]
[#ref_CHANGE_LOG_3_15][h4 Boost.Test v3.15 / boost 1.79]
[h5 New features]
[h5 Bugfixes and feature requests]
# [github_issue 268] Clang warning generated by dataset grid operation in C++20 mode
# [github_issue 272] Uninitialized memory in `framework_init_observer_t`
# [github_issue 284] Undefined behavior in `basic_cstring<CharT>::trim_right`
# [github_issue 297] `BOOST_TEST_GLOBAL_FIXTURE` documentation misleading
# [github_issue 305] boost test documentation tells users to file bugs with decommissioned Trac.
# [pull_request 286] fix uninitilized variable in `framework_init_observer_t`
# [pull_request 301] UB comparing unrelated pointers in `priority_order`
# [pull_request 275] Replace anonymous `enum` arity with `static constexpr`
# [pull_request 278] Use `boost_test_print_type` customization point in `lazy_ostream`
# [pull_request 281] Export `execution_aborted` exception to allow catching it from outside the DLL
[#ref_CHANGE_LOG_3_14][h4 Boost.Test v3.14 / boost 1.74]
[h5 New features]
* Now able to detect when running under a debugger on macOS/iOS. When running under a debugger, Boost.Test does not
try to catch system errors and the behaviour is the same as if the command line [link boost_test.utf_reference.rt_param_reference.catch_system `catch_system_error`]
option was set to `no`. Thanks to [@https://github.com/thughes Tom Hughes] for this feature.
* Adding support for Embarcadero C++ clang-based compilers, thanks to [@https://github.com/eldiener Edward Diener]
[h5 Bugfixes and feature requests]
# [github_issue 264] GCC suggest-override warnings
# [github_issue 269] Deprecated bind placeholders in tests
# [pull_request 142] Make `under_debugger` work on apple (iOS/macOS)
# [pull_request 266] Changes for Embarcadero C++ clang-based compilers
# [pull_request 267] Use macOS API only on macOS
[#ref_CHANGE_LOG_3_13][h4 Boost.Test v3.13 / boost 1.73]
[h5 New features]
* It is now possible to combine tolerance indication, user message and collection comparison modifier in a single `BOOST_TEST` expression
``
std::vector<double> v1 = f();
std::vector<double> v2{1.1, 1.19};
BOOST_TEST(v1 == v2, boost::test_tools::tolerance( 1e-3 ) << "comparison to ground truth failed" << boost::test_tools::per_element());
``
[h5 Bugfixes and feature requests]
# [github_issue 173] Compare collections of floating point values with tolerance
# [github_issue 179] `test_tools-test` failed on some archs
# [github_issue 220] Support for cuda `nvcc`
# [github_issue 221] Coverity security issue (minor) (`umask`)
# [github_issue 235] Ugly GCC `-Wattributes` warnings that cannot be suppressed using /included/ variant
# [github_issue 237] Clang-cl's `-Wdelete-non-abstract-non-virtual-dtor` triggered by `test_case_gen`
# [github_issue 241] warning: comparing floating point with == or != is unsafe `[-Wfloat-equal]`
# [github_issue 245] code coverity test defect
# [github_issue 246] Incorrect usage of `BOOST_HEADER_DEPRECATED`
# [github_issue 251] Context message are always printed if both HRF and Junit loggers are enabled
# [github_issue 253] Invalid XML log is generated by `BOOST_AUTO_TEST_CASE_TEMPLATE` when tests are skipped
# [github_issue 254] Console colors are not restored on Windows
# [github_issue 263] Windows: Header-only mode with multiple translation units requires `BOOST_TEST_NO_LIB`
# [pull_request 41] Fix: activate virtual destructors for all `msvc` versions
# [pull_request 114] Silence unreachable code warning in MSVC (`/W4`)
# [pull_request 187] enable `BOOST_TEST` with tolerance and user-message (through [github_issue 173])
# [pull_request 239] Fix unused variable warning in `unit_test_main.ipp`
# [pull_request 247] Use `__linux__` instead of `__linux`
# [pull_request 252] Fix compilation issue due to deleted `std::basic_ostream::operator<<` from `wchar_t`
# [pull_request 259] Avoid deprecated bind placeholders in global namespace
# [pull_request 265] Suppress the unused parameter warning for `root_test_unit_id`
# [ticket 11107] A lot of warnings on MSVC due to protected destructor being non-virtual
# [ticket 12072] Lots of `C4265` warnings in test when using Visual Studio 2015 (duplicates [ticket 11107])
[#ref_CHANGE_LOG_3_12][h4 Boost.Test v3.12 / boost 1.72]
[h5 New features]
* Support for C++17 `std::string_view` has been added.
* Better diagnostic on `boost::exception` and no rtti mode (thanks to Mikhail Pilin / [pull_request 234])
[h5 Bugfixes and feature requests]
# [github_issue 206] compile-time disabled test not correctly handled by junit log
# [github_issue 217] Data test cases fail with `bool` initializer list
# [github_issue 223] Unable to filter test by name (`-t`, `--run_test`) if template type contains multiple parameters
# [github_issue 229] Random shuffle deprecated
# [pull_request 227] Add `printf` format checking attribute to `report_error`
# [pull_request 231] OpenBSD is missing `SI_ASYNCIO` and `SI_MESGQ`
# [pull_request 232] fix timeout in windows
# [pull_request 234] `boost::diagnostic_information()` works in no `rtti` mode
[#ref_CHANGE_LOG_3_11][h4 Boost.Test v3.11 / boost 1.71]
[h5 New features]
* Now `BOOST_TEST` can be used to compare abstract types
[h5 Breaking changes]
* Marking more headers as deprecated: this might break some compilations
depending on the warning policies.
[h5 Bugfixes and feature requests]
# Fixing a small bug on named timers (Windows only). The bug is visible when
several test modules are executed in parallel on the same machine.
# [github_issue 209] `BOOST_TEST_CHECK` can't compare abstract classes using gcc
# [github_issue 218] Default file name (for logger output files)
# [pull_request 219] Commented out unused argument name (`stack_decorator::apply`)
# [pull_request 224] Add `BOOST_HEADER_DEPRECATED` to deprecated headers
[#ref_CHANGE_LOG_3_10][h4 Boost.Test v3.10 / boost 1.70]
[h5 New features]
* New documentation section about [link boost_test.runtime_config.custom_command_line_arguments custom command line]
arguments
* [link boost_test.tests_organization.test_cases.test_case_generation.datasets.dataset_interface Custom datasets]
are not required to declare a inner type `sample` anymore
* Boost.Test does not depend on Boost.Timer any more (which was pulling also Boost.Chrono
and Boost.System as transitive dependencies).
* Now Boost.Test raises an exception when the test case times-out on Windows. Prior to this release,
times-out on Windows were not failing the test cases. Note that signaling is not available on Windows,
and it is not possible to interrupt a test even in case of time out.
* Time-out now applies to test-suites as well: a test-suite is marked as timed-out if it exceeds the allocated
time. The test units that were not executed at the time-point of the time-out are skipped.
* It is now possible to pass several values for the same context via the tool
__BOOST_TEST_CONTEXT__.
* A new macro __BOOST_TEST_INFO_SCOPE__ let define a context for the current scope in a sticky way.
* It is now possible to use [link boost_test.testing_tools.extended_comparison.floating_point floating point]
comparison without being required to cast both operands to floating point types. Now Boost.Test uses floating
point comparisons for expressions such as
``
BOOST_TEST(3.0001 == 3);
``
See [link boost_test.testing_tools.extended_comparison.floating_point.type_promotion_of_the_operands this section]
for more information.
[h5 Breaking changes]
* Boost.Test `minimal.hpp` is now showing a deprecation warning. `minimal.hpp` has been
deprecated for a long time already, and will be removed in the near future. Please
switch to eg. the header only variable of Boost.Test. Tests using `minimal.hpp` can
readily be converted to the header variant. For instance, the following code:
``
#include <boost/test/minimal.hpp>
int test_main( int, char *[] )
{
...
}
``
may be rewritten as:
``
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE(test_main)
{
...
}
``
* The floating point comparison behavior change may use this type of comparison while previously
using straight relational operator comparison. In particular this may causes ['new warnings].
* the member function [memberref boost::unit_test::unit_test_log_formatter::log_build_info] has slightly changed
to accept an additional boolean argument. If you have a custom logger, you will need to update its signature.
[h5 Bugfixes and feature requests]
# [github_issue 133] Timeout effect on Windows
# [github_issue 138] expected_failures doesn't work for `BOOST_DATA_TEST_CASE`
# [github_issue 141] Support for Boost.MP11 and Boost.Hana type lists
# [github_issue 157] Test name should handle `const`-`volatile` specifiers
# [github_issue 160] suppress `-Wformat-overflow` when optimization is enabled on GCC 8.2.0
# [github_issue 174] `UBSAN` identified a problem at exit time by `gcc-8` only
# [github_issue 176] `[snippet_dataset1_3]` seems to be broken
# [github_issue 177] `boost_check_equal-str-test` failed on `llvm`
# [github_issue 180] Unreachable code warning on MSVC builds in test matrix
# [github_issue 181] `doc_example22` (and `23`) are expected to fail, but do not on clang with release variant builds
# [github_issue 194] `master_test_suite` declared twice
# [github_issue 196] junit report: test error is also reported as failure
# [github_issue 198] Support `BOOST_UNIT_TEST_FRAMEWORK_DYN_LINK` et al
# [github_issue 199] Runtime `type_mismatch` after upgrade to `1.69`
# [github_issue 202] `boost/timer.hpp` is deprecated
# [github_issue 203] Test cases with datasets and fixtures don't support flexible fixture interface
# [github_issue 204] Feature Request: Allow specifying timeouts for test cases with datasests.
# [github_issue 208] Incorrect handling of timed-tests on Windows
# [github_issue 211] `windows.h` should be lower case
# [github_issue 212] Comment `ar` parameter of `assertion_result` to avoid warning
# [github_issue 213] `BOOST_SYMBOL_VISIBLE` cannot be used for `enums` with Sun Studio
# [pull_request 171] Correct library name in test runner help screen
# [pull_request 172] Check for non-used variables when `NDEBUG` is defined
# [pull_request 182] fix use of `bind1st` in `example 12`
# [pull_request 183] remove superfluous semicolon in `example 04`
# [pull_request 184] fix example to use the correct variable and avoid unused variable warning
# [pull_request 185] Added CI framework
# [pull_request 190] fix warning on gcc-7.3 in cygwin claiming `master_test_suite` is declared differently
# [pull_request 195] Fix MinGW compilation problems
# [pull_request 197] Feature Request: `BOOST_TEST_CONTEXT` that doesn't require introducing a new scope with braces
# [pull_request 205] Fix MinGW `vsnprintf` compile errors and warnings
# [pull_request 214] Fixes an issue with sun_cc lacking the __global attribute for enums
# [ticket 7397] Boost.Test, since boost `1.48` is using the deprecated `Boost.Timer` class (solved via [github_issue 202])
# [ticket 9434] error: `namespace boost::timer {}` re-declared as different kind of symbol (solved via [github_issue 202])
# [ticket 13106] `libs/test/tools/console_test_runner` does not compile
# [ticket 13418] Request: allow general typelist types in `BOOST_AUTO_TEST_CASE_TEMPLATE()`
[#ref_CHANGE_LOG_3_9][h4 Boost.Test v3.9 / boost 1.69]
[h5 New features]
* Official support of header-only variant of Boost.Test with multiple translation units. This feature
was available but needed to be properly documented ([link boost_test.adv_scenarios.single_header_customizations.multiple_translation_units here]
and [link boost_test.usage_variants here]).
* It is now possible to manually add a test case by specifying its name, with __BOOST_TEST_CASE_NAME__
* Better logging of messages in `boost::exception`
[h5 Bugfixes and feature requests]
# [github_issue 149] Setting color_output=no does not disable the output of color format codes
# [github_issue 150] Some headers fail to compile independently
# [github_issue 156] `close_at_tolerance` always returns `false` for comparisons of infinity
# [github_issue 158] Detecting `boost_test_print_type` does not work when testing a type with an explicit conversion to `bool`
# [github_issue 163] Significant start slowdown on MSVC x64/Debug after upgrade to `v1.68.0`
# [pull_request 147] Catch block for `boost::exception` appears after `std::exception` in `execution_monitor::execute()`
# [pull_request 148] Colored output contradiction
# [pull_request 151] Fix warning: `BOOST_CLANG` is not defined, evaluates to `0`
# [pull_request 154] When specifying `--color_output=no`, don't output color codes
# [pull_request 161] add a self-containment test
# [ticket 13380] data-driven tests' join operator `+` corrupts first column (duplicates [ticket 12216])
# [ticket 13625] Boost.test fail to compile with `-Werror=missing-declarations` on some architectures
# [ticket 13637] Fix for Bug [ticket 12597] causes a problem with `BOOST_TEST_CASE`
[#ref_CHANGE_LOG_3_8][h4 Boost.Test v3.8 / boost 1.68]
[h5 New features]
* The tests generated from a dataset are now instantiated during the framework setup. This
let the dataset generator access the `argc` and `argv` of the master test suite. For indicating
a dataset that should be instantiated in a delayed manner, a new `data::make_delayed` helper has
been introduced.
* It is now possible to create a dataset with `data::make`, with variable number of arguments.
As the datasets are monomorphic, it should be possible to cast all elements to the first element type.
[h5 Breaking changes]
* the [link boost_test.tests_organization.test_tree.master_test_suite `master_test_suite_t`] is not copyable anymore.
* As datasets can now be delayed, it might be that additional copies of the dataset arguments are performed.
This is especially the case for datasets created out of an `std::initializer_list`.
[h5 Bugfixes and feature requests]
# [pull_request 143] Fix exception_api.run-fail.cpp doc example
# [pull_request 145] Fix build of library on recent Cygwin editions
# [ticket 12095] disabling test with precondition leads to error
# [ticket 12953] access to `master_test_suite().{argc, argv}`
# [ticket 13504] `[Boost::Test]` short form of `catch_system_errors` not working
# [ticket 13525] Boost Test 1.67.0: Compilation error with GCC 4.6.3
# [ticket 13528] Boost Test 1.67 crashes when the `--report_sink` command-line parameter is used
[#ref_CHANGE_LOG_3_7][h4 Boost.Test v3.7 / boost 1.67]
[h5 Breaking changes]
* Now colour is on by default for the output streams that are either `std::cout` or `std::cerr`. This can be
disabled by passing [link boost_test.utf_reference.rt_param_reference.color_output `--no_color_ouput`] (or just `--no_color`)
to the command line.
* Adding test cases with the same name to the same test suite is reported as an error. This impacts
[link boost_test.tests_organization.test_cases.test_organization_templates template] and
[link boost_test.tests_organization.test_cases.param_test parametrized] test cases, as well as manually
registered tests. Make sure you have no duplicate names.
[h5 New features]
* Colour output on Windows
* Improved and clearer command line help
* `BOOST_AUTO_TEST_CASE_TEMPLATE` now accepts a sequence of types in an `std::tuple`
[h5 Bugfixes and feature requests]
# [pull_request 112] Deliberate-failure tests shouldn't be optimized
# [pull_request 118] Update VxWorks support
# [pull_request 118] `[clang]` Fix `[-Wc++11-narrowing]` error
# [pull_request 121] fix compiler warning
# [pull_request 122] Fix some fallthrough warnings with `gcc >= 7`
# [pull_request 125] Prevent 2 unused parameter warnings
# [pull_request 127] Silence 'unused variable' warning
# [pull_request 134] Fix `stdcerr` file creation on shutdown
# [pull_request 136] Change `Windows.h` include to all-lowercase (MinGW)
# [ticket 12092] Request: allow `std::tuple` typelists in `BOOST_AUTO_TEST_CASE_TEMPLATE`
# [ticket 12596] Sanitize metacharacters in test names
# [ticket 12597] Report tests with clashing names
# [ticket 12969] Problem linking `print_helper_t<nullptr_t>` under Clang
# [ticket 13058] `errors.hpp` in Boost Test requires warning `C4946` to be `off`
# [ticket 13149] Dependency decorators on parent suites
# [ticket 13170] `BOOST_AUTO_TEST_CASE_TEMPLATE` don't want `typedef` for list
# [ticket 13181] Boost test can't compare classes which have `begin` and `end` but not `const_iterator`
# [ticket 13371] Use-after-free with `--log_sink=file`
# [ticket 13387] Test header fails to compile
# [ticket 13398] Log format JUNIT generates invalid XML files
# [ticket 13407] Boost.Test appears to crash under Cygwin
# [ticket 13435] `BOOST_TEST_GLOBAL_CONFIGURATION` (result report shutdown time)
# [ticket 13443] Boost.Test data driven test fails to compile when number of samples greater than 9
[#ref_CHANGE_LOG_3_6][h4 Boost.Test v3.6 / boost 1.65]
[h5 Breaking changes]
* __BOOST_GLOBAL_FIXTURE__ is flagged as deprecated and will be removed in a later version
* Using test assertions and macros is not allowed when used inside __BOOST_GLOBAL_FIXTURE__. Please use __BOOST_TEST_GLOBAL_FIXTURE__
instead (see below).
* the interface for loggers has slightly changed to take into account the current log level. This is for addressing [ticket 12631].
[h5 New features]
* VS2017 / C++17 compatibility (thanks to Daniela Engert)
* Deprecating __BOOST_GLOBAL_FIXTURE__ in favor of __BOOST_TEST_GLOBAL_FIXTURE__ and __BOOST_TEST_GLOBAL_CONFIGURATION__. This
helps separating the logic of the fixtures associated to the master test suite, from the one used for setting up the logging
and reporting facility, and results in a general cleaner design.
* It is possible to use now the __BOOST_TEST__ check to comparing a collection with respect to regular arrays. See
[link ref_boost_test_coll_c_arrays this section] for more details.
[h5 Bugfixes and feature requests]
# [pull_request 106] replace deprecated binders and adapters, and `random_shuffle` by more modern equivalents
# [ticket 5282] Test fixtures do not support virtual inheritance
# [ticket 5563] using a test macro in a global fixture crashes Boost.Test
# [ticket 11471] array is a sequence
# [ticket 11962] `BOOST_TEST_MESSAGE` in fixture constructor - invalid XML
# [ticket 12228] Some test headers fail to compile independently
# [ticket 12631] `BOOST_TEST_MESSAGE` generates incorrect output when used in `BOOST_DATA_TEST_CASE`
# [ticket 13011] `BOOST_TEST` broken with floating point relational operators
[#ref_CHANGE_LOG_3_5][h4 Boost.Test v3.5 / boost 1.64]
[h5 New features]
* Now Boost.Test provides [link ref_log_output_custom_customization_point customization points] for logging user defined types:
this solution is less intrusive than forcing the definition of `operator<<` for a specific type.
* [link boost_test.test_output.log_formats.log_junit_format JUnit output format] can now have a
[link boost_test.test_output.log_formats.test_log_output log-level] set between `success` and
`non-fatal error`, and defaults to `general information`.
* [link boost_test.test_output.log_formats.log_junit_format JUnit output format] is now more
efficient in case a lot of checks are done in a test module.
[h5 Bugfixes and feature requests]
# [pull_request 107] `BOOST_NO_EXCEPTIONS` typo making `throw_exception` unusable under some circumstances
# [pull_request 108] Change capital variable names to lowercase
# [ticket 11756] boost.Test: non standards compliant use of `FE_*` macros (unable to compile boost test library on FPU-less arches) (reopened)
# [ticket 12540] Provide customization point for printing types in tests
# [ticket 12712] `BOOST_AUTO_TEST_SUITE`: Generate unique names by using `__COUNTER__`
# [ticket 12748] Boost.Test defines a variable called `VERSION`
# [ticket 12778] Boost.Test is broken against left shift operator in certain cases (`nullptr` issue)
[#ref_CHANGE_LOG_3_4][h4 Boost.Test v3.4 / boost 1.63]
[h5 Breaking changes]
# Now colons that appear in test case names are replaced with underscores. This affect mainly the
[link boost_test.tests_organization.test_cases.test_organization_templates template/typed test cases].
The change is needed since the colon '`:`' is interpreted as a filter separators since 1.62, and it is
otherwise not possible to execute the tests reported by `--list_content`. See [ticket 12531] for more details.
[h5 New features]
* Now [link boost_test_coll_perelement `per_element`] and [link boost_test_coll_default_lex `lexicographic`] modifiers of __BOOST_TEST__
can also be applied to string comparison. See
[link boost_test.testing_tools.extended_comparison.strings string comparison] for more details.
[h5 Bugfixes and feature requests]
# [pull_request 103] Syntactic change silences latest gcc warnings
# [pull_request 105] Fix unused parameter warnings/errors with gcc 6
# [ticket 11756] boost.Test: non standards compliant use of `FE_*` macros (unable to compile boost test library on FPU-less arches)
# [ticket 11907] Why does `BOOST_TEST()` treat `std::string` as a collection?
# [ticket 12339] Propose users given way to disable blink in colour output
# [ticket 12506] typo in Boost.test `report_sink` description
# [ticket 12507] Boost.test `--report_sink` parameter broken
# [ticket 12530] No way to find out Boost.Test version without running any tests
# [ticket 12531] `--run_test` in Boost 1.62 does not accept test names which contain ':'
[#ref_CHANGE_LOG_3_3][h4 Boost.Test v3.3 / boost 1.62]
[h5 New features]
* Boost.Test now treats each sample of a dataset test case as being a uniquely named test case under the same test suite,
which enables the (re)run of one particular sample from the command line interface. See
[link boost_test.tests_organization.test_cases.test_case_generation.datasets_auto_registration.samples_and_test_tree here]
for more details,
* Boost.Test learned to interpret ':' as a separator for the test filters: the string passed to
[link boost_test.utf_reference.rt_param_reference.run_test `--run_test`]
generates tokens as if `--run_test` has been repeated, which enables the set up of several test filters
through the associated environment variable `BOOST_TEST_RUN_FILTERS`
* the __UTF__ learned to log the messages in the xUnit/JUNIT log format.
See [link boost_test.test_output.log_formats.log_junit_format here] for more details.
* the __UTF__ learned to have several loggers at the same time, each of which with their own log level and log sink.
See the associated command line switch [link boost_test.utf_reference.rt_param_reference.logger `--logger`] and
corresponding environment variable `BOOST_TEST_LOGGER` for more details.
* loggers are now able to indicate their default output stream and log level.
[h5 Bugfixes and feature requests]
# [pull_request 81] Possibility to remove the support of the alternative stack at compilation time. See
[link boost_test.utf_reference.link_references.config_disable_alt_stack `BOOST_TEST_DISABLE_ALT_STACK`] for more details.
# [ticket 8707] Provide Standard xUnit XML Output from Boost Test
# [ticket 8834] Boost Test should be able to generate report in both XML and HRF together
# [ticket 11128] `[bb10/qnx failures]` Build error
# [ticket 11845] Ability to generate the unique and stable test name for every data set in `BOOST_DATA_TEST_CASE`
# [ticket 11859] Wrong handling of "," in Run-Parameters
# [ticket 12024] boost test depends on nonexisting `abi::__cxa_demangle` on android
# [ticket 12093] Boost 1.60.0: Build fails (gcc 4.6)
# [ticket 12103] Fix for gcc bug 58952 (`getchar()` is defined as a macro in `uClibc`)
# [ticket 12224] Crash on MSVC with RTTI disabled
# [ticket 12241] Data-driven testing over a range of `std::tuple` has broken
# [ticket 12257] Incorrect line numbers in `test_units` generated from `test_case_gen`
# [ticket 12378] Compilation errors with clang 3.8
[#ref_CHANGE_LOG_3_2][h4 Boost.Test v3.2 / boost 1.61]
[h5 New features]
* now datasets support any [link boost_test.tests_organization.test_cases.test_case_generation.datasets arity], using the
variadic template support of the compiler.
* now datasets support fixtures through `BOOST_DATA_TEST_CASE_F`, see
[link boost_test.tests_organization.test_cases.test_case_generation.datasets here] for more details
* now datasets honors move semantics of the types used for samples
[h5 Bugfixes and feature requests]
# [ticket 6767] Use of namespace qualifier with floating point exception functions breaks if they are macros
# [ticket 8905] `boost/test/impl/debug.ipp`: Ignores return value from `WaitForSingleObject`
# [ticket 9443] Runtime parameter Random seed for random order of test cases not respected correctly
# [ticket 11854] Add fixture support in `BOOST_DATA_TEST_CASE`
# [ticket 11887] `BOOST_TEST(3u == (std::max)(0u, 3u))` fails
# [ticket 11889] `BOOST_DATA_TEST_CASE` fails to compile for 4D and higher dimensional grids
# [ticket 11983] Boost Test XML Report contains unescaped XML characters
[#ref_CHANGE_LOG_3_1][h4 Boost.Test v3.1 / boost 1.60]
[h5 New major features]
* improved API for datasets
* it is now possible to use initializer lists
* the use of `make` as top left dataset is not necessary anymore
* improved command line interface
* clearer help commands
* now proposes closest matching command in case of ambiguity
* reports invalid or ambiguous parameters: this might break existing calls when user defined commands are
provided to the test module. The following calling convention should be adopted:
* if the test module uses user supplied commands, those should be passed after an empty token `--`
* all boost.test related commands should be passed before `--`, if any
Example:
the call
``
test_module --user-arg1=xy --log_level=test_suite
``
should be rewritten to
``
test_module --log_level=test_suite -- --user-arg1=xy
``
[h5 Bugfixes and feature requests]
# [ticket 3384] Double-quoted arguments including spaces are divided by Boost.Test.
# [ticket 3897] Test framework does not include `<osreldate.h>` before testing `__FreeBSD_version` (fixed in 1.59)
# [ticket 6032] Program options within `init_unit_test_suite` are incorrect when using path and whitespaces
# [ticket 6859] Boost.Test eats away last empty command line parameter
# [ticket 7257] Boost.Test alters and does not restore `ostream` precision after any Test macro (fixed in 1.59)
# [ticket 9228] Patch to make Boost.Test work with RTTI disabled (fixed in 1.59)
# [ticket 10317] boost::test corrupts contents of `argv` if a paramter contains whitespace
# [ticket 11279] invalid parameters should be reported
# [ticket 11478] Boost Test Exception Assert Failure has poor message
# [ticket 11571] Can't compile `BOOST_TEST( ..., per_element() )` comparison of `vector<string>`
# [ticket 11623] Clang rejects some simple `BOOST_TEST()` statements
# [ticket 11624] `BOOST_TEST( 0.0 == 0.0 )` fails under C++11 (GCC and Clang)
# [ticket 11625] `BOOST_TEST( ..., per_element() )` erroneously requires collections are comparable
[#ref_CHANGE_LOG_3_0][h4 Boost.Test v3 / boost 1.59]
[h5 New major features]
* __BOOST_TEST__ generic assertion
* [link boost_test.tests_organization.test_cases.test_case_generation data driven test cases]: supersedes the parametric test case (unary test cases)
* test units [link boost_test.tests_organization.decorators attributes], that allow finer control over test units property and behavior
* logical grouping of the test units using [link boost_test.tests_organization.tests_grouping labels]
* support for declaring [link boost_test.tests_organization.tests_dependencies dependencies] over test cases
* attributes for [link boost_test.tests_organization.enabling enabling or disabling] test execution based on static, compile-time or runtime rules
* extended [link boost_test.runtime_config.test_unit_filtering unit test filtering] from the command line (negation, labels, ...)
* color output with [link boost_test.utf_reference.rt_param_reference.color_output `color_output`]
* test bed listing with [link boost_test.utf_reference.rt_param_reference.list_content `list_content`]
* rewritten documentation using quickbook
[/* now having a more accurate timing (see [ticket 7397]) for the tests. Old format is still available through the command line option __param_deprecated_timer_format__
in case you experience problems with the new output. ]
[h5 Bugfixes and feature requests]
[/ pending
# [ticket 1136] Let BOOST_CHECK_EQUAL support `std::wstring`
# [ticket 4222] `feenablexcept` does not exist on mac
# [ticket 7397] Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class - it should be updated to use the new class
]
# [ticket 2018] Error in the documentation chapter "Runtime parameters reference"
# [ticket 2450] equations in Floating-point comparison algorithms html are not rendered properly
# [ticket 2600] Unit Test Framework - missed documentation
# [ticket 2717] `BOOST_<level>_EQUAL_COLLECTION` docs typo
# [ticket 2759] Typos in test new-year-resolution.html
# [ticket 3182] `_CrtSetReportFile` can be used to redirect memory leaks report
# [ticket 3316] Access violation when trying to log from `init_tests_func`
# [ticket 3392] Boost::Test: Wrong contents for documentation of the `BOOST_TEST_PASSPOINT` macro
# [ticket 3402] Invalid define name in documentation (duplicates #[ticket 2717])
# [ticket 3445] incorrect link in the docs
# [ticket 3463] `GT` is GREAT!
# [ticket 3542] Bug in documentation of detect_memory_leak parameter (duplicates #[ticket 2018])
# [ticket 3481] Boost Testing doesn't work under Sun Solaris Containers (duplicates #[ticket 3592])
# [ticket 3495] Boost::Test enters endless loop when running in `vserver` environment (duplicates #[ticket 3592])
# [ticket 3592] under_debugger() goes into infinite loop
# [ticket 3595] Typo (duplicates #[ticket 2759])
# [ticket 3623] Boost Test Typo (duplicates #[ticket 2759])
# [ticket 3664] `SIGCHLD` always considered fatal error
# [ticket 3784] Documentation errors in Execution Monitor Compilation
# [ticket 3785] Documentation errors in Program Execution Monitor implementation
# [ticket 3811] global namespace pollution
# [ticket 3834] doc: probably incorrect HTML rendering (duplicates #[ticket 2450])
# [ticket 3896] erroneous documentation in boost test command line parameter description
# [ticket 3932] Error in `BOOST_<level>_GT` description (duplicates #[ticket 3463])
# [ticket 3938] doc: incorrect macro name (duplicates #[ticket 2759])
# [ticket 3964] Documentation for `BOOST_<level>_CLOSE_FRACTION` is incorrect
# [ticket 3978] Failed to completely redirect TestLog to file, bugfix appended
# [ticket 3979] `<boost/test/exception_safety.hpp>` requires additional includes
# [ticket 4161] spelling mistakes...
# [ticket 4275] Documentation error Boost.Test (duplicates #[ticket 2717])
# [ticket 4389] Enable boost_test to run specific tests with any required dependent tests.
# [ticket 4434] `BOOST_AUTO_EST_CASE` typos in docs
# [ticket 4587] Broken link in website
# [ticket 4806] Invalid link (examples not showing up in documentation)
# [ticket 4911] ENH: boost.test output the exception real type name.
# [ticket 4923] Missing semicolon in documentation example
# [ticket 4924] Minor typo in Boost::Test docs
# [ticket 4982] Boost.Test has misspelled Gennadiy Rozental e-mail address
# [ticket 5008] Boost.Test does not do check-pointing of entry/exit of test cases
# [ticket 5036] Boost.Test VC memory leak report should direct to `stderr`
# [ticket 5262] Run tests by name utility doesn't support negation
# [ticket 5374] Errors from Boost.Test are no more shown in the Error list in VS2010
# [ticket 5412] XML formatter in test library processes strings with subsequences `]]>` incorrectly
# [ticket 5563] using a test macro in a global fixture crashes Boost.Test
# [ticket 5582] There is a memory leak in the `BOOST_AUTO_TEST_CASE_TEMPLATE`
# [ticket 5599] boost::test documentation gives poor instruction
# [ticket 5718] broken link to unit testing framework examples
# [ticket 5729] Missing static_cast in fpt_limits
# [ticket 5870] The warning stack is not maintained
# [ticket 5972] Support program option to only dump the test-tree in text to output stream
# [ticket 6002] Failed to completely redirect TestLog to file (duplicates)
# [ticket 6071] Boost Test (Boost 1.46.0) GCC 4.6.1 error: ambiguous overload for operator[]
# [ticket 6074] warnings-as-errors not usable with Boost.test in release mode
# [ticket 6161] SunOS: bad `putenv` declaration (duplicates [ticket 6766])
# [ticket 6766] incorrect declaration for `putenv` in `config.hpp`
# [ticket 6712] Eliminate warnings with GCC
# [ticket 6748] Link in the documentation points to wrong page
# [ticket 7046] Output full error message, not just 512 chars
# [ticket 7136] Correct documentation for `BOOST_<level>_CLOSE_FRACTION` is not reflected into released documents
# [ticket 7410] Test Units (Cases and Suites) in Boost.Test do not capture `__FILE__` and `__LINE__` at declaration point making it impossible to provide source file linking using external test management tools
# [ticket 7894] Boost.Test documentation contains no linking instructions
# [ticket 8201] Broken link in document
# [ticket 8272] `BOOST_REQUIRE_CLOSE` fails to compile with `boost::multiprecision::cpp_dec_float_100` (duplicates #[ticket 11054])
# [ticket 8467] Incorrect link in document (duplicates #[ticket 6748])
# [ticket 8679] Boost.Test pollutes boost namespace with it's own `enable_if/disable_if` templates
# [ticket 8862] Boost.Test typo in documentation
# [ticket 8895] English error in test collection comparison
# [ticket 9179] Documentation: broken link (unable to find =const_string.hpp/const_string_test.cpp=)
# [ticket 9272] boost::test `BOOST_<level>_GT` documentation bug (duplicates #[ticket 3463])
# [ticket 9390] Incomplete `BOOST_TEST_DONT_PRINT_LOG_VALUE`
# [ticket 9409] Some source code examples are missing
# [ticket 9537] const_string_test example fails
# [ticket 9539] Floating-point comparison algorithms aren't formatted correctly
# [ticket 9581] Squassabia reference link gives 404 not found
# [ticket 9960] Warnings on Clang
# [ticket 10256] [boost test] - issue: `sigaltstack`
# [ticket 10318] Minor documentation fix
# [ticket 10394] Broken links in Boost Test documentation
# [ticket 10888] Assertion failures don't show up in the errors pane in VS 2010, VS 2012 or VS 2013 (duplicates)
# [ticket 11054] Floating-point comparison of multiprecision values fails if expression template is on
# [ticket 11347] `DS` identifier causes test failures in `doc/examples/dataset_example*.cpp`
# [ticket 11358] Boost.Test v3 warning could helpfully be suppressed.
# [ticket 11359] `BOOST_CHECK_EQUAL_COLLECTIONS`: can't control output operator (duplicates #9390)
# [ticket 11425] use-of-uninitialized-value (obsolete)
[endsect]

View File

@@ -0,0 +1,177 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:section_faq Frequently Asked Questions]
[h3 Where the latest version of the Boost Test Library is located?]
The latest version of Boost Test Library is available online at [@http://www.boost.org/libs/test].
[h3 Bug report of feature request: what should I do?]
You can send a bug report or a feature request to the boost users' mailing list boost-users@lists.boost.org and/or fill
a ticket on the GitHub issues of the project [@https://github.com/boostorg/test].
[h3 How to create test case using the Unit Test Framework?]
To create a test case, use the macro
__BOOST_AUTO_TEST_CASE__( test_function );
For more details see the Unit Test Framework __BOOST_AUTO_TEST_CASE__ documentation.
[h3 Is Boost.Test thread safe?]
Short answer: no, but we welcome patches!
Longer answer: Boost.Test currently has no synchronization mechanisms in place to avoid any race when
multiple threads are calling the assertion macros. For instance this code
``
BOOST_TEST_CASE(test_parallel)
{
std::vector<std::string> vect(10);
std::for_each(
std::execution::par_unseq,
vect.begin(),
vect.end(),
[](auto const& str)
{
BOOST_TEST(str == "");
});
}
``
will not work as expected as the assertion `BOOST_TEST` will be called from multiple threads.
[h3 How to create test suite using the Unit Test Framework?]
To create a test suite use the macro
__BOOST_AUTO_TEST_SUITE__( suite_name );
For more details see the Unit Test Framework __BOOST_AUTO_TEST_SUITE__ documentation.
[h3 Why did I get a linker error when compiling my test program?]
Boost Test Library components provide several usage variants: to create a test program you can
link with the one of the precompiled library variants or use header-only variant. For example, to use Unit Test
Framework you may either include
``
#include <boost/test/unit_test.hpp>
``
and link with ``libunit_test_framework.lib`` or you can include
``
#include <boost/test/included/unit_test.hpp>
``
in which case you should not need to link with any pre-compiled component. Note also that
you should strictly follow specification on initialization function in other case some compilers may produce linker
error like this.
``
Unresolved external init_unit_test_suite(int, char**).
``
The reason for this error is that in your implementation you should specify second argument of
`init_unit_test_suite` exactly as in the specification, i.e.: `char* []`.
[h3 How can I redirect testing output?]
Use ``unit_test_log::instance().set_log_output( std::ostream & )``
For more details see the __UTF__ __output_test_stream_tool__ documentation.
[h3 I want different default log trace level]
Use environment variable __BOOST_TEST_LOG_LEVEL__ to define desired log trace level. You still will be able to reset
this value from the command line. For the list of acceptable values see the __UTF__
__runtime_configuration__ documentation.
[h3 Is there DLL version of Boost.Test components available on Win32 platform?]
Yes. Starting with Boost 1.34.0.
[h3 How to set up a CMake project using __UTF__ (extended)]
Suppose, you are building a test module from one translation unit `test_file.cpp`. First, let's do it using the [link boost_test.usage_variants.single_header header-only usage variant] of the __UTF__.
Let's paste the following content in a `CMakeLists.txt`
at the same location than our test file `test_file.cpp`:
[pre
cmake_minimum_required(VERSION 2.8.7)
project(my_first_test)
enable_testing()
# indicates the location of the boost installation tree.
# hard-coded for our simple example.
set(BOOST_INCLUDE_DIRS $boost_installation_prefix/include)
# creates the executable
add_executable(test_executable test_file.cpp)
# indicates the include paths
target_include_directories(test_executable PRIVATE ${BOOST_INCLUDE_DIRS})
# declares a test with our executable
add_test(NAME test1 COMMAND test_executable)
]
We will now create the build directory for this project (separate directory),
configure and build the project, as follow:
```
> cd ``$``test_path
> mkdir build /*< we create a directory dedicated to the build, to avoid
any pollution of the sources with the temporary
build files >*/
> cd build
> cmake .. /*< configuration of the project >*/
> cmake --build . /*< this command builds the project, cmake drives a native
tool that is configured on the previous command line >*/
> ctest /*< runs the tests declared in the project and prints a report >*/
```
In the case you are using the [link boost_test.usage_variants.shared_lib shared libraries] variant of __UTF__,
some modifications should be done in your CMakeLists.txt.
[pre
cmake_minimum_required(VERSION 2.8.11)
project(my_first_test)
enable_testing()
# replace XX with the version you have
set(Boost_ADDITIONAL_VERSIONS "1.XX" "1.XX.0")
# finds boost, triggers an error otherwise
find_package(Boost XX REQUIRED COMPONENTS unit_test_framework)
# creates the executable
add_executable(test_executable test_file.cpp)
# indicates the include paths
target_include_directories(test_executable PRIVATE ${Boost_INCLUDE_DIRS})
# indicates the shared library variant
target_compile_definitions(test_executable PRIVATE "BOOST_TEST_DYN_LINK=1")
# indicates the link paths
target_link_libraries(test_executable ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
# declares a test with our executable
add_test(NAME test1 COMMAND test_executable)
]
We will now create the build directory for this project (separate directory), configure and build the project,
as follow:
```
> cd ``$``test_path
> mkdir build /*< we create a directory dedicated to the build, to avoid any pollution of the sources with the temporary
build files >*/
> cd build
> cmake -DBOOST_ROOT=``$``boost_installation_prefix .. /*< configuration of the project, the `BOOST_ROOT` configuration element indicates the
Boost module of `cmake` where to find our installation >*/
> cmake --build . /*< this command builds the project, cmake drives a native tool that is configured on the
previous command line >*/
> ctest /*< runs the tests declared in the project and prints a report >*/
```
[endsect] [/faq]

View File

@@ -0,0 +1,103 @@
[/
/ Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:section_glossary Glossary]
Here is the list of terms used throughout this documentation.
[#ref_test_module][h3 Test module]
This is a single binary that performs the test. Physically a test module consists of one or more test source files,
which can be built into an executable or a dynamic library. A test module that consists of a single test source
file is called ['single-file test module]. Otherwise
it's called ['multi-file test module]. Logically, each test module consists of four parts:
# [link test_setup test setup] (or test initialization),
# [link test_body test body]
# [link test_cleanup test cleanup]
# [link test_runner test runner]
The test runner part is optional. If a test module is built as
an executable, the test runner is built-in. If a test module is built as a dynamic library, it is run by an
[link boost_test.adv_scenarios.external_test_runner external test runner].
[warning The test module should have at least one test-case defined, otherwise it is considered as an error.]
[#test_body][h3 Test body]
This is the part of a test module that actually performs the test.
Logically test body is a collection of [link test_assertion test assertions] wrapped in
[link test_case test cases], which are organized in a [link ref_test_tree test tree].
[#ref_test_tree][h3 Test tree]
This is a hierarchical structure of [link test_suite test suites] (non-leaf nodes) and
[link test_case test cases] (leaf nodes). More details can be found [link boost_test.tests_organization here].
[#ref_test_unit][h3 Test unit]
This is a collective name when referred to either a [link test_suite test suite] or
[link test_case test cases]. See [link boost_test.tests_organization this section] for more details.
[#test_assertion][h3 Test assertion]
This is a single binary condition (binary in a sense that is has two outcomes: pass and fail) checked
by a test module.
There are different schools of thought on how many test assertions a test case should consist of. Two polar
positions are the one advocated by TDD followers - one assertion per test case; and opposite of this - all test
assertions within single test case - advocated by those only interested in the first error in a
test module. The __UTF__ supports both approaches.
[#test_case][h3 Test case]
This is an independently monitored function within a test module that
consists of one or more test assertions. The term ['independently monitored] in the definition above is
used to emphasize the fact, that all test cases are monitored independently. An uncaught exception or other normal
test case execution termination doesn't cause the testing to cease. Instead the error is caught by the test
case execution monitor, reported by the __UTF__ and testing proceeds to the next test case. Later on you are going
to see that this is on of the primary reasons to prefer multiple small test cases to a single big test function.
[#test_suite][h3 Test suite]
This is a container for one or more test cases. The test suite gives you an ability to group
test cases into a single referable entity. There are various reasons why you may opt to do so, including:
* To group test cases per subsystems of the unit being tested.
* To share test case setup/cleanup code.
* To run selected group of test cases only.
* To see test report split by groups of test cases.
* To skip groups of test cases based on the result of another test unit in a test tree.
A test suite can also contain other test suites, thus allowing a hierarchical test tree structure to be formed.
The __UTF__ requires the test tree to contain at least one test suite with at least one test case. The top level
test suite - root node of the test tree - is called the master test suite.
[#test_setup][h3 Test setup]
This is the part of a test module that is responsible for the test
preparation. It includes the following operations that take place prior to a start of the test:
* The __UTF__ initialization
* Test tree construction
* Global test module setup code
* ['Per test case] setup code, invoked for every test case it's assigned to, is also attributed to the
test initialization, even though it's executed as a part of the test case.
[#test_cleanup][h3 Test cleanup]
This is the part of test module that is responsible for cleanup operations.
[#test_fixture][h3 Test fixture]
Matching setup and cleanup operations are frequently united into a single entity called test fixture.
[#test_runner][h3 Test runner]
This is an ['orchestrator] or a ['driver] that, given the test tree, ensures the test tree is initialized, tests are executed and necessary reports generated. For more information [link boost_test.adv_scenarios.test_module_runner_overview see here].
[#test_log][h3 Test log]
This is the record of all events that occur during the testing.
[#test_report][h3 Test report]
This is the report produced by the __UTF__ after the testing is completed, that indicates which test cases/test
suites passed and which failed.
[endsect] [/ Glossary]

View File

@@ -0,0 +1,16 @@
//[example_output
> ./boost_runtime_list_content --list_content
s1*: disabled suite 1
test1*: enabled
test2 : defaulted
test3 : defaulted
s14 : test suite which depends on another test suite
test1
s2*
test1 : defaulted
test2*: enabled w. precondition
s23*
test1
test2
test3*
//]

View File

@@ -0,0 +1,108 @@
// (C) Copyright 2015 Boost.Test team.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE list_content
#include <boost/test/included/unit_test.hpp>
namespace utf=boost::unit_test;
//// --------------------------------------------------------------------------
// Test suite 1, disabled by default, s1/test2 is explicitely enabled.
BOOST_AUTO_TEST_SUITE( s1,
* utf::disabled() // suite is not disabled because of the
* utf::description( "disabled suite 1") // extra declaration at the end of the file
* utf::label( "label1" )
* utf::label( "label2" ))
BOOST_AUTO_TEST_CASE( test1, // s1/test1
* utf::enabled() * utf::description("enabled"))
{
BOOST_TEST(true);
}
BOOST_AUTO_TEST_CASE( test2, // s1/test2
* utf::description( "defaulted") * utf::expected_failures( 1 ))
{
BOOST_TEST(false);
}
BOOST_AUTO_TEST_CASE( test3, // s1/test3
* utf::description( "defaulted"))
{
BOOST_TEST(false);
}
BOOST_AUTO_TEST_SUITE_END()
//// --------------------------------------------------------------------------
// Test suite 2, disabled by default, s2/test2 is explicitely enabled.
BOOST_AUTO_TEST_SUITE( s2,
* utf::disabled()
* utf::label( "label1" )
* utf::expected_failures( 3 ))
BOOST_AUTO_TEST_CASE( test1, // s2/test1
* utf::description( "defaulted"))
{
BOOST_TEST(false);
}
boost::test_tools::assertion_result do_it( utf::test_unit_id )
{
return false;
}
BOOST_AUTO_TEST_CASE( test2, // s2/test2
* utf::enabled()
* utf::description( "enabled w. precondition")
* utf::precondition(do_it))
{
BOOST_TEST(false);
}
//// --------------------------------------------------------------------------
// Test suite s2/s23, disabled
BOOST_AUTO_TEST_SUITE( s23, * utf::disabled())
BOOST_AUTO_TEST_CASE( test1 ) // s2/s23/test1
{
BOOST_TEST(false);
}
BOOST_AUTO_TEST_CASE( test2, // s2/s23/test2
* utf::timeout( 10 ))
{
BOOST_TEST( true );
}
BOOST_AUTO_TEST_CASE( test3, // s2/s23/test3
* utf::enabled()
* utf::depends_on( "s2/test2" ))
{
BOOST_TEST( true );
}
BOOST_AUTO_TEST_SUITE_END() // s2/s23
BOOST_AUTO_TEST_SUITE_END() // s2
//// --------------------------------------------------------------------------
// Test suite s1 continued
BOOST_AUTO_TEST_SUITE( s1 )
BOOST_AUTO_TEST_SUITE( s14,
* utf::depends_on( "s2/s23/test3" )
* utf::description( "test suite which depends on another test suite"))
BOOST_AUTO_TEST_CASE( test1, // s1/s14/test1
* utf::depends_on( "s2" ))
{
BOOST_TEST( "s14" == "test" );
}
BOOST_AUTO_TEST_SUITE_END() // s1/s14
BOOST_AUTO_TEST_SUITE_END() // s1
//]

View File

@@ -0,0 +1,21 @@
//[example_output
> ./boost_test_bitwise --log_level=all
Running 1 test case...
Entering test module "boost_test_bitwise"
test.cpp(13): Entering test case "test_bitwise"
test.cpp(17): error: in "test_bitwise": check a == (a & ~1) has failed [171 != 170]. Bitwise comparison failed
Mismatch at position 0
test.cpp(18): error: in "test_bitwise": check a == a + 1 has failed [171 != 172]. Bitwise comparison failed
Mismatch at position 0
Mismatch at position 1
Mismatch at position 2
test.cpp(19): info: check a != a + 1 has passed
test.cpp(21): error: in "test_bitwise": check a == b has failed [171 != 136]. Bitwise comparison failed
Mismatch at position 0
Mismatch at position 1
Mismatch at position 5
test.cpp(13): Leaving test case "test_bitwise"; testing time: 627us
Leaving test module "boost_test_bitwise"; testing time: 772us
*** 3 failures are detected in the test module "boost_test_bitwise"
//]

View File

@@ -0,0 +1,23 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_bitwise
#include <boost/test/included/unit_test.hpp>
#include <sstream>
BOOST_AUTO_TEST_CASE(test_bitwise)
{
namespace tt = boost::test_tools;
int a = 0xAB;
BOOST_TEST( a == (a & ~1), tt::bitwise() );
BOOST_TEST( a == a + 1, tt::bitwise() );
BOOST_TEST( a != a + 1, tt::bitwise() );
int b = 0x88;
BOOST_TEST( a == b, tt::bitwise() );
}
//]

View File

@@ -0,0 +1,13 @@
//[example_output
> ./boost_test_container_default --log_level=all
Running 1 test case...
Entering test module "boost_test_sequence"
test.cpp(13): Entering test case "test_collections_vectors"
test.cpp(23): info: check a < c has passed
test.cpp(24): error: in "test_collections_vectors": check a >= c has failed
test.cpp(25): info: check a != c has passed
test.cpp(13): Leaving test case "test_collections_vectors"; testing time: 208us
Leaving test module "boost_test_sequence"; testing time: 286us
*** 1 failure is detected in the test module "boost_test_container_default"
//]

View File

@@ -0,0 +1,27 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_sequence
#include <boost/test/included/unit_test.hpp>
#include <vector>
BOOST_AUTO_TEST_CASE( test_collections_vectors )
{
std::vector<int> a{1,2,3}, c{1,5,3,4};
std::vector<long> b{1,5,3};
// the following does not compile
//BOOST_TEST(a == b);
//BOOST_TEST(a <= b);
// stl defaults to lexicographical comparison
BOOST_TEST(a < c);
BOOST_TEST(a >= c);
BOOST_TEST(a != c);
}
//]

View File

@@ -0,0 +1,24 @@
//[example_output
> ./boost_test_container_lex --log_level=all
Running 2 test cases...
Entering test module "boost_test_container_lex"
test.cpp:15: Entering test case "test_collections_vectors_lex"
test.cpp:19: error: in "test_collections_vectors_lex": check a < a has failed
Collections appear to be equal.
test.cpp:20: error: in "test_collections_vectors_lex": check a < b has failed
Failure at position 2: 3 >= 2.
test.cpp:21: info: check a < c has passed
test.cpp:22: error: in "test_collections_vectors_lex": check a >= c has failed
Second collection has extra trailing elements.
test.cpp:15: Leaving test case "test_collections_vectors_lex"; testing time: 178us
test.cpp:28: Entering test case "test_compare_c_arrays_lexicographic"
test.cpp:35: info: check a < b has passed
test.cpp:36: error: in "test_compare_c_arrays_lexicographic": check b < c has failed
Collections appear to be equal.
test.cpp:37: error: in "test_compare_c_arrays_lexicographic": check c < a has failed
Failure at position 1: 5 >= 2.
test.cpp:28: Leaving test case "test_compare_c_arrays_lexicographic"; testing time: 88us
Leaving test module "boost_test_container_lex"; testing time: 323us
*** 5 failures are detected in the test module "boost_test_container_lex"
//]

View File

@@ -0,0 +1,39 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_container_lex
#include <boost/test/included/unit_test.hpp>
#include <vector>
namespace tt = boost::test_tools;
BOOST_AUTO_TEST_CASE( test_collections_vectors_lex )
{
std::vector<int> a{1,2,3}, b{1,2,2}, c{1,2,3,4};
BOOST_TEST(a < a, tt::lexicographic());
BOOST_TEST(a < b, tt::lexicographic());
BOOST_TEST(a < c, tt::lexicographic());
BOOST_TEST(a >= c, tt::lexicographic());
//BOOST_TEST(a == c, tt::lexicographic()); // does not compile
//BOOST_TEST(a != c, tt::lexicographic()); // does not compile
}
BOOST_AUTO_TEST_CASE( test_compare_c_arrays_lexicographic )
{
int a[] = {1, 2, 3};
int b[] = {1, 5, 3};
std::vector<long> c{1, 5, 3};
// BOOST_TEST(a == b, boost::test_tools::lexicographic()); // does not compile
// BOOST_TEST(a != b, boost::test_tools::lexicographic()); // does not compile
BOOST_TEST(a < b, boost::test_tools::lexicographic());
BOOST_TEST(b < c, boost::test_tools::lexicographic());
BOOST_TEST(c < a, boost::test_tools::lexicographic());
}
//]

View File

@@ -0,0 +1,19 @@
//[example_output
> ./boost_test_container_lex_default --log_level=all
Running 1 test case...
Entering test module "boost_test_container_lex_default"
test.cpp:17: Entering test case "test_collections_vectors_lex"
test.cpp:22: error: in "test_collections_vectors_lex": check a < a has failed.
Collections appear to be equal.
test.cpp:23: error: in "test_collections_vectors_lex": check a < b has failed.
Failure at position 2: 3 >= 2.
test.cpp:24: error: in "test_collections_vectors_lex": check a == b has failed.
Mismatch at position 2: 3 != 2.
test.cpp:25: info: check a != b has passed
test.cpp:26: error: in "test_collections_vectors_lex": check c < d has failed
test.cpp:27: error: in "test_collections_vectors_lex": check c == d has failed
test.cpp:17: Leaving test case "test_collections_vectors_lex"; testing time: 155us
Leaving test module "boost_test_container_lex_default"; testing time: 177us
*** 5 failures are detected in the test module "boost_test_container_lex_default"
//]

View File

@@ -0,0 +1,29 @@
// (C) Copyright Raffi Enficiaud 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_container_lex_default
#include <boost/test/included/unit_test.hpp>
#include <vector>
namespace tt = boost::test_tools;
BOOST_TEST_SPECIALIZED_COLLECTION_COMPARE(std::vector<int>)
BOOST_AUTO_TEST_CASE( test_collections_vectors_lex )
{
std::vector<int> a{1,2,3}, b{1,2,2};
std::vector<long int> c{1,2,3,5}, d{1,2,3,4};
BOOST_TEST(a < a); // lexcographic
BOOST_TEST(a < b); // lexcographic
BOOST_TEST(a == b); // element-wise
BOOST_TEST(a != b); // extended diagnostic
BOOST_TEST(c < d); // no extended diagnostic
BOOST_TEST(c == d); // no extended diagnostic
}
//]

View File

@@ -0,0 +1,10 @@
//[example_output
> ./boost_test_macro2 --log_level=all
Running 2 test cases...
test.cpp(16): error: in "test_op_precedence": check a % b == c has failed [13 % 2 != 12]
test.cpp(18): error: in "test_op_precedence": check a == c % b has failed [13 != 0]
test.cpp(25): error: in "test_op_right_associative": check !a has failed
test.cpp(26): error: in "test_op_right_associative": check --a has failed [(bool)0 is false]
*** 4 failures are detected in the test module "boost_test_macro2"
//]

View File

@@ -0,0 +1,28 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_macro2
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test_op_precedence )
{
int a = 13, b = 2, c = 12;
// left term of == is expanded in the logs
BOOST_TEST(a % b == c);
// right term of == is not expanded in the logs
BOOST_TEST(a == c % b);
}
BOOST_AUTO_TEST_CASE( test_op_right_associative )
{
int a = 1;
BOOST_TEST(a);
BOOST_TEST(!a);
BOOST_TEST(--a);
}
//]

View File

@@ -0,0 +1,14 @@
//[example_output
> ./boost_test_macro3 --log_level=all
Running 1 test case...
Entering test module "boost_test_macro3"
test.cpp(12): Entering test case "test_op_reportings"
test.cpp(15): error: in "test_op_reportings": check a == b has failed [13 != 12]
test.cpp(16): error: in "test_op_reportings": check a < b has failed [13 >= 12]
test.cpp(17): error: in "test_op_reportings": check a - 1 < b has failed [13 - 1 >= 12]
test.cpp(18): error: in "test_op_reportings": check b > a - 1 has failed [12 <= 12]
test.cpp(12): Leaving test case "test_op_reportings"; testing time: 484us
Leaving test module "boost_test_macro3"; testing time: 588us
*** 2 failures are detected in the test module "boost_test_macro3"
//]

View File

@@ -0,0 +1,20 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_macro3
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test_op_reportings )
{
int a = 13, b = 12;
BOOST_TEST(a == b);
BOOST_TEST(a < b);
BOOST_TEST(a - 1 < b);
BOOST_TEST(b > a - 1);
}
//]

View File

@@ -0,0 +1,19 @@
//[example_output
> ./boost_test_containers_c_arrays --log_level=all
Running 1 test case...
Entering test module "boost_test_containers_c_arrays"
test.cpp:15: Entering test case "test_collections_on_c_arrays"
test.cpp:20: info: check a == a has passed
test.cpp:21: error: in "test_collections_on_c_arrays": check a == b has failed.
Collections size mismatch: 3 != 4
test.cpp:22: info: check a != b has passed
test.cpp:23: info: check a < b has passed
test.cpp:24: error: in "test_collections_on_c_arrays": check b < c has failed.
Collections appear to be equal.
test.cpp:25: error: in "test_collections_on_c_arrays": check c < a has failed.
Failure at position 1: 5 >= 2.
test.cpp:15: Leaving test case "test_collections_on_c_arrays"; testing time: 204us
Leaving test module "boost_test_containers_c_arrays"; testing time: 240us
*** 3 failures are detected in the test module "boost_test_containers_c_arrays"
//]

View File

@@ -0,0 +1,27 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_containers_c_arrays
#include <boost/test/included/unit_test.hpp>
#include <vector>
namespace tt = boost::test_tools;
BOOST_AUTO_TEST_CASE( test_collections_on_c_arrays )
{
int a[] = {1, 2, 3};
int b[] = {1, 5, 3, 4};
std::vector<long> c{1, 5, 3, 4};
BOOST_TEST(a == a); // element-wise compare
BOOST_TEST(a == b); // element-wise compare
BOOST_TEST(a != b);
BOOST_TEST(a < b); // lexicographical compare
BOOST_TEST(b < c); // lexicographical compare
BOOST_TEST(c < a); // lexicographical compare
}
//]

View File

@@ -0,0 +1,17 @@
//[example_output
> ./boost_test_macro_overview --log_level=all
Running 1 test case...
Entering test module "boost_test_macro_overview"
test.cpp:12: Entering test case "test_macro_overview"
test.cpp:17: error: in "test_macro_overview": check a != b - 1 has failed [1 == 1]
test.cpp:18: error: in "test_macro_overview": check a + 1 < b has failed [1 + 1 >= 2]
test.cpp:19: error: in "test_macro_overview": 1 < 1 does not hold
test.cpp:20: error: in "test_macro_overview": check a == b has failed [1 != 2]. Bitwise comparison failed
Mismatch at position 0
Mismatch at position 1
test.cpp:21: error: in "test_macro_overview": check a + 0.1 == b - 0.8 has failed [1 + 0.10000000000000001 != 1.2]. Relative difference exceeds tolerance [0.0909091 > 0.01]
test.cpp:12: Leaving test case "test_macro_overview"; testing time: 380us
Leaving test module "boost_test_macro_overview"; testing time: 459us
*** 5 failures are detected in the test module "boost_test_macro_overview"
//]

View File

@@ -0,0 +1,23 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_macro_overview
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test_macro_overview )
{
namespace tt = boost::test_tools;
int a = 1;
int b = 2;
BOOST_TEST(a != b - 1);
BOOST_TEST(a + 1 < b);
BOOST_TEST(b -1 > a, a << " < " << b - 1 << " does not hold");
BOOST_TEST(a == b, tt::bitwise());
BOOST_TEST(a + 0.1 == b - 0.8, tt::tolerance(0.01));
}
//]

View File

@@ -0,0 +1,14 @@
//[example_output
> ./boost_test_macro_workaround --log_level=all
Running 2 test cases...
Entering test module "boost_test_macro_workaround"
test.cpp:13: Entering test case "test_logical_not_allowed"
test.cpp:17: info: check (true && true) has passed
test.cpp:13: Leaving test case "test_logical_not_allowed"; testing time: 183us
test.cpp:20: Entering test case "test_ternary"
test.cpp:26: info: check (a + 1 == b ? true : false) has passed
test.cpp:20: Leaving test case "test_ternary"; testing time: 123us
Leaving test module "boost_test_macro_workaround"; testing time: 547us
*** No errors detected
//]

View File

@@ -0,0 +1,30 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_macro_workaround
#include <boost/test/included/unit_test.hpp>
#include <sstream>
BOOST_AUTO_TEST_CASE( test_logical_not_allowed )
{
// Boost Unit Test Framework prevents compilation of
// BOOST_TEST(true && true);
BOOST_TEST((true && true)); // with extra brackets, it works as expected
}
BOOST_AUTO_TEST_CASE( test_ternary )
{
int a = 1;
int b = 2;
// Boost Unit Test Framework prevents compilation of
// BOOST_TEST(a == b ? true : false);
BOOST_TEST((a + 1 == b ? true : false)); // again works as expected with extra brackets
}
//]

View File

@@ -0,0 +1,12 @@
//[example_output
> ./boost_test_message --log_level=all
Running 1 test case...
Entering test module "boost_test_message"
test.cpp(12): Entering test case "test_message"
test.cpp(15): error: in "test_message": a should be equal to b: 1!=2
test.cpp(16): info: check 'value of a=1' has passed
test.cpp(12): Leaving test case "test_message"; testing time: 219us
Leaving test module "boost_test_message"; testing time: 318us
*** 1 failure is detected in the test module "boost_test_message"
//]

View File

@@ -0,0 +1,18 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_message
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test_message )
{
const int a(1), b(2);
BOOST_TEST(a == b, "a should be equal to b: " << a << "!=" << b);
BOOST_TEST(a != 10, "value of a=" << a);
}
//]

View File

@@ -0,0 +1,33 @@
//[example_output
> ./boost_test_sequence_per_element
Running 2 test cases...
test.cpp:21: error: in "test_sequence_per_element": check a == b has failed
Mismatch at position 1: 2 != 5.
test.cpp:23: error: in "test_sequence_per_element": check a != b has failed
Mismatch at position 0: 1 == 1.
Mismatch at position 2: 3 == 3.
test.cpp:25: error: in "test_sequence_per_element": check b < c has failed
Collections size mismatch: 3 != 4
test.cpp:26: error: in "test_sequence_per_element": check b >= c has failed
Collections size mismatch: 3 != 4
test.cpp:27: error: in "test_sequence_per_element": check b != c has failed
Collections size mismatch: 3 != 4
test.cpp:35: error: in "test_compare_c_arrays_element_wise": check a == b has failed
Mismatch at position 1: 2 != 5.
test.cpp:36: error: in "test_compare_c_arrays_element_wise": check a != b has failed
Mismatch at position 0: 1 == 1.
Mismatch at position 2: 3 == 3.
test.cpp:37: error: in "test_compare_c_arrays_element_wise": check a < b has failed
Mismatch at position 0: 1 >= 1.
Mismatch at position 2: 3 >= 3.
test.cpp:38: error: in "test_compare_c_arrays_element_wise": check b < c has failed
Mismatch at position 0: 1 >= 1.
Mismatch at position 1: 5 >= 5.
Mismatch at position 2: 3 >= 3.
test.cpp:39: error: in "test_compare_c_arrays_element_wise": check c < a has failed
Mismatch at position 0: 1 >= 1.
Mismatch at position 1: 5 >= 2.
Mismatch at position 2: 3 >= 3.
*** 10 failures are detected in the test module "boost_test_sequence_per_element"
//]

View File

@@ -0,0 +1,41 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_sequence_per_element
#include <boost/test/included/unit_test.hpp>
#include <vector>
#include <list>
namespace tt = boost::test_tools;
BOOST_AUTO_TEST_CASE( test_sequence_per_element )
{
std::vector<int> a{1,2,3};
std::vector<long> b{1,5,3};
std::list<short> c{1,5,3,4};
BOOST_TEST(a == b, tt::per_element()); // nok: a[1] != b[1]
BOOST_TEST(a != b, tt::per_element()); // nok: a[0] == b[0] ...
BOOST_TEST(a <= b, tt::per_element()); // ok
BOOST_TEST(b < c, tt::per_element()); // nok: size mismatch
BOOST_TEST(b >= c, tt::per_element()); // nok: size mismatch
BOOST_TEST(b != c, tt::per_element()); // nok: size mismatch
}
BOOST_AUTO_TEST_CASE( test_compare_c_arrays_element_wise )
{
int a[] = {1, 2, 3};
int b[] = {1, 5, 3};
std::vector<long> c{1, 5, 3};
BOOST_TEST(a == b, boost::test_tools::per_element());
BOOST_TEST(a != b, boost::test_tools::per_element());
BOOST_TEST(a < b, boost::test_tools::per_element());
BOOST_TEST(b < c, boost::test_tools::per_element());
BOOST_TEST(c < a, boost::test_tools::per_element());
}
//]

View File

@@ -0,0 +1,17 @@
//[example_output
> ./boost_test_strings
Running 2 test cases...
test.cpp:17: error: in "test_pointers": check pa == pb has failed [0x7fff54f9dea4 != 0x7fff54f9dea0]
test.cpp:25: error: in "test_strings": check a == b has failed [test1 != test2]
test.cpp:27: error: in "test_strings": check std::string("test1") == b has failed [test1 != test2]
test.cpp:28: error: in "test_strings": check std::string("test1") < a has failed
Mismatch at position 0: 't' >= 't'.
Mismatch at position 1: 'e' >= 'e'.
Mismatch at position 2: 's' >= 's'.
Mismatch at position 3: 't' >= 't'.
Mismatch at position 4: '1' >= '1'.
test.cpp:29: error: in "test_strings": check b < a has failed
Failure at position 4: '2' >= '1'.
*** 5 failures are detected in the test module "boost_test_strings"
//]

View File

@@ -0,0 +1,31 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_strings
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test_pointers )
{
float a(0.5f), b(0.5f);
const float* pa = &a, *pb = &b;
BOOST_TEST(a == b);
BOOST_TEST(pa == pb);
}
BOOST_AUTO_TEST_CASE( test_strings )
{
const char* a = "test1";
const char* b = "test2";
const char* c = "test1";
BOOST_TEST(a == b);
BOOST_TEST(a == c);
BOOST_TEST(std::string("test1") == b);
BOOST_TEST(std::string("test1") < a, boost::test_tools::per_element());
BOOST_TEST(b < a, boost::test_tools::lexicographic());
}
//]

View File

@@ -0,0 +1,8 @@
//[example_output
> custom_init
using custom init
Running 1 test case...
test.cpp(7): error: in "test1": check false has failed
*** 1 failure is detected in the test module "Master Test Suite"
//]

View File

@@ -0,0 +1,23 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/test/included/unit_test.hpp>
#include <iostream>
BOOST_AUTO_TEST_CASE(test1)
{
BOOST_TEST(false);
}
bool init_unit_test()
{
std::cout << "using custom init" << std::endl;
return true;
}
//]

View File

@@ -0,0 +1,8 @@
//[example_output
> custom_main
Using custom entry point...
Running 1 test case...
test.cpp(10): error: in "test1": check false has failed
*** 1 failure is detected in the test module "custom_main"
//]

View File

@@ -0,0 +1,31 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE custom_main
#define BOOST_TEST_NO_MAIN
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/test/included/unit_test.hpp>
#include <iostream>
namespace utf = boost::unit_test;
BOOST_AUTO_TEST_CASE(test1)
{
BOOST_TEST(false);
}
void make_use_of(char**)
{
std::cout << "Using custom entry point..." << std::endl;
}
int main(int argc, char* argv[], char* envp[])
{
make_use_of(envp);
return utf::unit_test_main(init_unit_test, argc, argv);
}
//]

View File

@@ -0,0 +1,8 @@
//[example_output
> custom_obsolete_init
using obsolete init
Running 1 test case...
test.cpp(6): error: in "test1": check false has failed
*** 1 failure is detected in the test module "Master Test Suite"
//]

View File

@@ -0,0 +1,22 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#include <boost/test/included/unit_test.hpp>
#include <iostream>
BOOST_AUTO_TEST_CASE(test1)
{
BOOST_TEST(false);
}
boost::unit_test::test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])
{
std::cout << "using obsolete init" << std::endl;
return 0;
}
//]

View File

@@ -0,0 +1,17 @@
//[example_output
> dataset_example59
Running 8 test cases...
test 1: 0
test 1: 1
test 1: 2
test 1: 3
test 1: 4
test 2: 1
test 2: 4
test 2: 7
test.cpp(27): error: in "test2/_2": check (sample <= 4 && sample >= 0) has failed
Failure occurred in a following context:
sample = 7;
*** 1 failure is detected in the test module "dataset_example59"
//]

View File

@@ -0,0 +1,29 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example59
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace bdata = boost::unit_test::data;
BOOST_DATA_TEST_CASE( test1, bdata::xrange(5) )
{
std::cout << "test 1: " << sample << std::endl;
BOOST_TEST((sample <= 4 && sample >= 0));
}
BOOST_DATA_TEST_CASE(
test2,
bdata::xrange<int>( (bdata::begin=1, bdata::end=10, bdata::step=3)) )
{
std::cout << "test 2: " << sample << std::endl;
BOOST_TEST((sample <= 4 && sample >= 0));
}
//]

View File

@@ -0,0 +1,8 @@
//[example_output
> dataset_example61
Running 2 test cases...
1, qwerty
2, asdfg
*** No errors detected
//]

View File

@@ -0,0 +1,27 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example61
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace data = boost::unit_test::data;
int samples1[] = {1,2};
char const* samples2[] = {"qwerty", "asdfg"};
BOOST_DATA_TEST_CASE(
test1,
data::make(samples1)^samples2,
integer_values,
string_value)
{
std::cout << integer_values << ", " << string_value << std::endl;
}
//]

View File

@@ -0,0 +1,11 @@
//[example_output
> dataset_example62
Running 5 test cases...
1
2
8
9
10
*** No errors detected
//]

View File

@@ -0,0 +1,26 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example62
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace data = boost::unit_test::data;
int samples1[] = {1, 2};
int samples2[] = {8, 9, 10};
BOOST_DATA_TEST_CASE(
test1,
data::make(samples1) + samples2,
var)
{
std::cout << var << std::endl;
}
//]

View File

@@ -0,0 +1,23 @@
//[example_output
> dataset_example63
Running 14 test cases...
test 1: 2, 0
test 1: 3, 1
test 1: 2, 2
test 1: 8, 3
test 1: 10, 4
test 1: 15, 5
test 1: 8, 6
test 2: 1.00001, 0
test 2: 1.13154, 1
test 2: 1.75561, 2
test.cpp(35): error: in "test2/_2": check random_sample < 1.7 has failed [1.75560534 >= 1.7]
Failure occurred in a following context:
random_sample = 1.75560534; index = 2;
test 2: 1.45865, 3
test 2: 1.53277, 4
test 2: 1.21896, 5
test 2: 1.04704, 6
*** 1 failure is detected in the test module "dataset_example63"
//]

View File

@@ -0,0 +1,37 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example63
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace bdata = boost::unit_test::data;
BOOST_DATA_TEST_CASE(
test1,
bdata::random(1, 17) ^ bdata::xrange(7),
random_sample, index )
{
std::cout << "test 1: " << random_sample
<< ", " << index << std::endl;
BOOST_TEST((random_sample <= 17 && random_sample >= 1));
}
BOOST_DATA_TEST_CASE(
test2,
bdata::random( (bdata::distribution=std::uniform_real_distribution<float>(1, 2)) )
^ bdata::xrange(7),
random_sample, index )
{
std::cout << "test 2: " << random_sample
<< ", " << index << std::endl;
BOOST_TEST(random_sample < 1.7); // 30% chance of failure
}
//]

View File

@@ -0,0 +1,21 @@
//[example_output
> dataset_example64
Running 12 test cases...
test 1: 0, 0
test 1: 0, 1
test 1: 0, 2
test 1: 1, 0
test 1: 1, 1
test 1: 1, 2
test 2: 0 / 1.00001, 0
test 2: 0 / 1.13154, 1
test 2: 1 / 1.75561, 0
test.cpp(40): error: in "test2/_2": check random_sample < 1.7 has failed [1.75560534 >= 1.7]
Failure occurred in a following context:
xr = 1; random_sample = 1.75560534; index = 0;
test 2: 1 / 1.45865, 1
test 2: 2 / 1.53277, 0
test 2: 2 / 1.21896, 1
*** 1 failure is detected in the test module "dataset_example64"
//]

View File

@@ -0,0 +1,42 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example64
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace bdata = boost::unit_test::data;
BOOST_DATA_TEST_CASE(
test1,
bdata::xrange(2) * bdata::xrange(3),
xr1, xr2)
{
std::cout << "test 1: " << xr1 << ", " << xr2 << std::endl;
BOOST_TEST((xr1 <= 2 && xr2 <= 3));
}
BOOST_DATA_TEST_CASE(
test2,
bdata::xrange(3)
*
( bdata::random(
bdata::distribution=std::uniform_real_distribution<float>(1, 2))
^ bdata::xrange(2)
),
xr, random_sample, index)
{
std::cout << "test 2: "
<< xr << " / "
<< random_sample << ", " << index
<< std::endl;
BOOST_TEST(random_sample < 1.7); // 30% chance of failure
}
//]

View File

@@ -0,0 +1,10 @@
//[example_output
> dataset_example65
Running 4 test cases...
test 1: 2
test 2: 0, 2
test 2: 1, 2
test 2: 2, 2
*** No errors detected
//]

View File

@@ -0,0 +1,38 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example65
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace bdata = boost::unit_test::data;
BOOST_DATA_TEST_CASE(
test1,
bdata::make(2),
singleton)
{
std::cout
<< "test 1: "
<< singleton << std::endl;
BOOST_TEST(singleton == 2);
}
BOOST_DATA_TEST_CASE(
test2,
bdata::xrange(3) ^ bdata::make(2),
xr, singleton)
{
std::cout
<< "test 2: "
<< xr << ", " << singleton << std::endl;
BOOST_TEST(singleton == 2);
}
//]

View File

@@ -0,0 +1,8 @@
//[example_output
> dataset_example66
Running 2 test cases...
test 1: 0, cat
test 1: 1, dog
*** No errors detected
//]

View File

@@ -0,0 +1,29 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example66
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace bdata = boost::unit_test::data;
const char* arr[] = {"cat", "dog"};
BOOST_DATA_TEST_CASE(
test1,
bdata::xrange(2) ^ bdata::make(arr),
xr, array_element)
{
std::cout << "test 1: "
<< xr << ", "
<< array_element
<< std::endl;
BOOST_TEST(array_element != "mammoth");
}
//]

View File

@@ -0,0 +1,21 @@
//[example_output
> dataset_example67
Running 15 test cases...
test 1: 0
test 1: 1
test 1: 1
test 1: 2
test 1: 3
test 1: 5
test 1: 8
test 1: 13
test 2: "0", 0
test 2: "1", 1
test 2: "13", 13
test 2: "2", 2
test 2: "3", 3
test 2: "5", 5
test 2: "8", 8
*** No errors detected
//]

View File

@@ -0,0 +1,69 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE example67
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
#include <sstream>
namespace bdata = boost::unit_test::data;
// Generates a Fibonacci sequence
std::vector<float> fibonacci() {
std::vector<float> ret(8);
ret[0] = 0;
ret[1] = 1;
for(std::size_t s(2); s < ret.size(); s++)
{
ret[s] = ret[s-1] + ret[s-2];
}
return ret;
}
BOOST_DATA_TEST_CASE(
test1,
bdata::make(fibonacci()),
array_element)
{
std::cout << "test 1: "
<< array_element
<< std::endl;
BOOST_TEST(array_element <= 13);
}
// Generates a map from a vector
std::map<std::string, float> vect_2_str(std::vector<float> v)
{
std::map<std::string, float> out;
for(std::size_t s(0); s < v.size(); s++)
{
std::ostringstream o;
o << v[s];
out[o.str()] = v[s];
}
return out;
}
typedef std::pair<const std::string, float> pair_map_t;
BOOST_TEST_DONT_PRINT_LOG_VALUE( pair_map_t )
BOOST_DATA_TEST_CASE(
test2,
bdata::make(vect_2_str(fibonacci())),
array_element)
{
std::cout << "test 2: \""
<< array_element.first << "\", "
<< array_element.second
<< std::endl;
BOOST_TEST(array_element.second <= 13);
}
//]

View File

@@ -0,0 +1,12 @@
//[example_output
> example68
Running 9 test cases...
test.cpp(60): error: in "test1/_7": check fib_sample == exp has failed [34 != 35]
Failure occurred in a following context:
fib_sample = 34; exp = 35;
test.cpp(60): error: in "test1/_8": check fib_sample == exp has failed [55 != 56]
Failure occurred in a following context:
fib_sample = 55; exp = 56;
*** 2 failures are detected in the test module "dataset_example68"
//]

View File

@@ -0,0 +1,61 @@
// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE dataset_example68
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
#include <sstream>
namespace bdata = boost::unit_test::data;
// Dataset generating a Fibonacci sequence
class fibonacci_dataset {
public:
// the type of the samples is deduced
static const int arity = 1;
struct iterator {
iterator() : a(1), b(1) {}
int operator*() const { return b; }
void operator++()
{
a = a + b;
std::swap(a, b);
}
private:
int a;
int b; // b is the output
};
fibonacci_dataset() {}
// size is infinite
bdata::size_t size() const { return bdata::BOOST_TEST_DS_INFINITE_SIZE; }
// iterator
iterator begin() const { return iterator(); }
};
namespace boost { namespace unit_test { namespace data { namespace monomorphic {
// registering fibonacci_dataset as a proper dataset
template <>
struct is_dataset<fibonacci_dataset> : boost::mpl::true_ {};
}}}}
// Creating a test-driven dataset, the zip is for checking
BOOST_DATA_TEST_CASE(
test1,
fibonacci_dataset() ^ bdata::make( { 1, 2, 3, 5, 8, 13, 21, 35, 56 } ),
fib_sample, exp)
{
BOOST_TEST(fib_sample == exp);
}
//]

View File

@@ -0,0 +1,7 @@
//[example_output
> decorator_00 --list_content
test_1*: with description
test_1*: with description
test_1*: with description
test_1*: with description
//]

View File

@@ -0,0 +1,21 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE decorator_00
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
namespace utf = boost::unit_test;
namespace data = boost::unit_test::data;
BOOST_TEST_DECORATOR(* utf::description("with description"))
BOOST_DATA_TEST_CASE(test_1, data::xrange(4))
{
BOOST_TEST(sample >= 0);
}
//]

View File

@@ -0,0 +1,12 @@
//[example_output
> decorator_01 --run_test=@trivial
Running 2 test cases...
*** No errors detected
> decorator_01 --run_test=@cmp
Running 1 test case...
*** No errors detected
//]

View File

@@ -0,0 +1,25 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE decorator_01
#include <boost/test/included/unit_test.hpp>
namespace utf = boost::unit_test;
BOOST_AUTO_TEST_CASE(test_case1, * utf::label("trivial"))
{
BOOST_TEST(true);
}
BOOST_AUTO_TEST_CASE(test_case2,
* utf::label("trivial")
* utf::label("cmp")
* utf::description("testing equality of ones"))
{
BOOST_TEST(1 == 1);
}
//]

View File

@@ -0,0 +1,6 @@
//[example_output
> decorator_02 --run_test=@trivial
Running 2 test cases...
*** No errors detected
//]

View File

@@ -0,0 +1,26 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE decorator_02
#include <boost/test/included/unit_test.hpp>
namespace utf = boost::unit_test;
BOOST_AUTO_TEST_SUITE(suite1, * utf::label("trivial"))
BOOST_AUTO_TEST_CASE(test_case1)
{
BOOST_TEST(true);
}
BOOST_AUTO_TEST_CASE(test_case2)
{
BOOST_TEST(1 == 1);
}
BOOST_AUTO_TEST_SUITE_END()
//]

View File

@@ -0,0 +1,12 @@
//[example_output
> decorator_03 --run_test=@trivial
Running 3 test cases...
*** No errors detected
> decorator_03 --run_test=@simple
Running 3 test cases...
*** No errors detected
//]

View File

@@ -0,0 +1,39 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE decorator_03
#include <boost/test/included/unit_test.hpp>
namespace utf = boost::unit_test;
BOOST_AUTO_TEST_SUITE(suite1, * utf::label("trivial"))
BOOST_AUTO_TEST_CASE(test_case1)
{
BOOST_TEST(true);
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(suite1, * utf::label("simple"))
BOOST_AUTO_TEST_CASE(test_case2)
{
BOOST_TEST(true);
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(suite1)
BOOST_AUTO_TEST_CASE(test_case3)
{
BOOST_TEST(true);
}
BOOST_AUTO_TEST_SUITE_END()
//]

View File

@@ -0,0 +1,25 @@
//[example_output
> decorator_04
Running 3 test cases...
test.cpp(8): error: in "test1": check false has failed
test.cpp(15): error: in "test2": check false has failed
test.cpp(20): error: in "test3": check false has failed
*** 3 failures are detected in the test module "decorator_04"
> decorator_04 --run_test=@l1
Running 2 test cases...
test.cpp(8): error: in "test1": check false has failed
test.cpp(15): error: in "test2": check false has failed
*** 2 failures are detected in the test module "decorator_04"
> decorator_04 --run_test=@l2
Running 1 test case...
test.cpp(15): error: in "test2": check false has failed
*** 1 failure is detected in the test module "decorator_04"
//]

View File

@@ -0,0 +1,30 @@
// (C) Copyright Andrzej Krzemienski 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE decorator_04
#include <boost/test/included/unit_test.hpp>
namespace utf = boost::unit_test;
BOOST_AUTO_TEST_CASE(test1,
* utf::label("l1"))
{
BOOST_TEST(false);
}
BOOST_AUTO_TEST_CASE(test2,
* utf::label("l1")
* utf::label("l2"))
{
BOOST_TEST(false);
}
BOOST_AUTO_TEST_CASE(test3)
{
BOOST_TEST(false);
}
//]

Some files were not shown because too many files have changed in this diff Show More