Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests tweaks #38

Merged
merged 3 commits into from
Nov 13, 2021
Merged

Tests tweaks #38

merged 3 commits into from
Nov 13, 2021

Commits on Nov 13, 2021

  1. test: make tests runnable with ctest

    This helps with automated testing, as tests can be ran with `ctest` or
    by "building" the target `test`
    
    I also changed the way the C++ standard version is handled; the tests
    require C++17, and this was previously accomplished by manually passing
    the `-std=c++17` flag, while the "CMake way" of doing this is to set the
    `CXX_STANDARD` property. Unfortunately the value `17` of the property
    was only added in CMake 3.8, so I bumped the minimum required version.
    I've also set the `CXX_EXTENSIONS` and `CXX_STANDARD_REQUIRED` to false
    and true, respectively, to ensure that `-std=c++17` gets passed instead
    of `-std=gnu++17` on GCC-like compilers and that CMake doesn't fallback
    to older standards versions when the requested standard is not available
    Tachi107 committed Nov 13, 2021
    Configuration menu
    Copy the full SHA
    68656ba View commit details
    Browse the repository at this point in the history
  2. build: use system GTest when available

    This reduces compile times and allows tests to be ran in environments
    without internet access (e.g. when building a Debian package).
    
    CMake will look for an installed copy of GoogleTest on the system, and
    will use it if found, and will fallback to download and unpack it
    otherwise.
    Tachi107 committed Nov 13, 2021
    Configuration menu
    Copy the full SHA
    94c882e View commit details
    Browse the repository at this point in the history
  3. build: use -pthread when possible

    Using -pthread is the "right way" of enabling threading support in GCC
    and similar, and this can accomplished with the
    THREADS_PREFER_PTHREAD_FLAG option. Its use is also recommended by the
    CMake devs, see
    https://cmake.org/cmake/help/latest/module/FindThreads.html#variable:THREADS_PREFER_PTHREAD_FLAG
    Tachi107 committed Nov 13, 2021
    Configuration menu
    Copy the full SHA
    c3d7e5e View commit details
    Browse the repository at this point in the history