mabrarov / asio_test

Testing Bost.Asio internals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests for Boost.Asio

Travis CI build status AppVeyor CI build status

Building

Requirements

  1. C++ toolchain
    • Microsoft Visual Studio 2015-2019
    • MinGW 7+
    • GCC 6+
    • Clang 6+
  2. CMake 3.2+
  3. Boost C++ Libraries 1.73.0+

Assumptions

  1. asio_test_home environment variable contains path to local copy of this repository
  2. build_dir environment variable specifies build directory, it may be different than asio_test_home for "out of source tree" build, it may be build subdirectory of asio_test_home
  3. If Boost C++ Libraries are taken not from system paths, then header files of Boost are located at directory specified by boost_headers_dir environment variable and binary files of Boost are located at directory specified by boost_libs_dir environment variable
  4. build_type environment variable specifies CMake build type
    • Debug
    • Release
    • RelWithDebInfo
    • MinSizeRel
  5. cmake_generator environment variable is CMake generator
    • Visual Studio 14 2015 - Visual Studio 2015
    • Visual Studio 15 2017 - Visual Studio 2017
    • Visual Studio 16 2019 - Visual Studio 2019
    • NMake Makefiles - NMake makefiles
    • MinGW Makefiles - MinGW makefiles
    • Unix Makefiles - Unix / Linux makefiles
  6. cmake_platform environment variable is CMAKE_GENERATOR_PLATFORM
    • Win32 - x86 platform when using Visual Studio
    • x64 - amd64 (x64) platform when using Visual Studio
  7. Unix / Linux commands use Bash
  8. Windows commands use Windows Command Prompt

Build steps

  1. Generate project for build system from CMake project, assuming current directory is build_dir

    • Unix / Linux, Boost C++ Libraries are taken from system paths

      cmake_generator="Unix Makefiles" && \
      cmake -D CMAKE_BUILD_TYPE="${build_type}" -G "${cmake_generator}" "${asio_test_home}"
    • Windows, Visual Studio 2015 x64 CMake generator, shared C/C++ runtime, Boost C++ Libraries are taken not from system paths and are linked statically (refer to FindBoost CMake module for CMake variables which can be used to specify the way search for Boost C++ Libraries is performed)

      set "cmake_generator=Visual Studio 14 2015"
      set "cmake_platform=x64"
      cmake ^
      -D Boost_NO_SYSTEM_PATHS=ON ^
      -D BOOST_INCLUDEDIR="%boost_headers_dir%" ^
      -D BOOST_LIBRARYDIR="%boost_libs_dir%" ^
      -D Boost_USE_STATIC_LIBS=ON ^
      -G "%cmake_generator%" -A "%cmake_platform%" "%asio_test_home%"
    • Windows, Visual Studio 2015 x64 CMake generator, static C/C++ runtime, Boost C++ Libraries are taken not from system paths and are linked statically

      set "cmake_generator=Visual Studio 14 2015"
      set "cmake_platform=x64"
      cmake ^
      -D CMAKE_USER_MAKE_RULES_OVERRIDE="%asio_test_home%\cmake\static_c_runtime_overrides.cmake" ^
      -D CMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%asio_test_home%\cmake\static_cxx_runtime_overrides.cmake" ^
      -D Boost_NO_SYSTEM_PATHS=ON ^
      -D BOOST_INCLUDEDIR="%boost_headers_dir%" ^
      -D BOOST_LIBRARYDIR="%boost_libs_dir%" ^
      -D Boost_USE_STATIC_LIBS=ON ^
      -G "%cmake_generator%" -A "%cmake_platform%" "%asio_test_home%"
    • Windows, MinGW makefiles CMake generator, static C/C++ runtime, Boost C++ Libraries are taken not from system paths and are linked statically

      set "cmake_generator=MinGW Makefiles"
      cmake ^
      -D CMAKE_USER_MAKE_RULES_OVERRIDE="%asio_test_home%\cmake\static_c_runtime_overrides.cmake" ^
      -D CMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%asio_test_home%\cmake\static_cxx_runtime_overrides.cmake" ^
      -D Boost_NO_SYSTEM_PATHS=ON ^
      -D BOOST_INCLUDEDIR="%boost_headers_dir%" ^
      -D BOOST_LIBRARYDIR="%boost_libs_dir%" ^
      -D Boost_USE_STATIC_LIBS=ON ^
      -D CMAKE_BUILD_TYPE="%build_type%" ^
      -G "%cmake_generator%" "%asio_test_home%"
  2. Build generated project with build system chosen at previous step via CMake generator

    • Unix / Linux

      cmake --build "${build_dir}" --config "${build_type}"
    • Windows

      cmake --build "%build_dir%" --config "%build_type%"

Usage

Refer to

  1. src/strand_test/README.md

About

Testing Bost.Asio internals


Languages

Language:PowerShell 45.5%Language:C++ 24.0%Language:Shell 20.6%Language:CMake 9.9%