profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/Falaina/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

Falaina/AsmJit-Python 9

Python bindings for AsmJit

Falaina/Denshi 1

Prototype for a Synchtube bot

Falaina/dotfiles 1

.files, including ~/.osx — sensible hacker defaults for OS X

Falaina/gsce 1

PersonA ~オペラ座の怪人~ Translation Tools

Falaina/mooege 1

An educational game server emulator written in C#

Falaina/node-irc 1

NodeJS IRC client library

Falaina/Pymem 1

[OBSOLETE] A python library for windows, providing the needed functions to start working on your own with memory editing. [OBSOLETE]

Falaina/pypgf 1

Some Python tools for working with pgf fonts.

issue openedcatchorg/Catch2

-o option failed when directory path not exists on Windows

Describe the bug When running test with the -o with a file path in a directory taht do not exist

Expected behavior Catch2 should be able to recursively create the path of the output file

Reproduction steps use -r xml -o "DirectoryDoNotExists/report.xml"

Platform information:

  • OS: Windows 10

created time in 10 hours

issue openedcatchorg/Catch2

__fastcall as compiler flag not working with Catch2

Describe the bug When compiling with MSVC or Clang-cl with the /Gr flags, the __cdecl wmain is not found. The wmain function signature must be extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * [])

Note: /Gr specifies the __fastcall calling convention for all functions except C++ member functions, functions named main, and functions that are marked __cdecl, __stdcall, or __vectorcall.

Expected behavior Catch2 must compile with the flags /Gr and found the wmain signature.

Reproduction steps Add the flags /Gr to the compilation with MSVC or clang-cl

Platform information:

  • Windows
  • Visual Studio
  • Toolset tested : v142 and clang-cl

created time in 10 hours

issue commentcatchorg/Catch2

fatal error: 'catch2/catch.hpp' file not found on macOS Big Sur after install with brew

I installed Catch2 on my macOS Big Sur, M1 chip, using the command

``brew install catch2''

Then, when I try to compile using Clang version 12.0.0, I get the error:

``fatal error: 'catch2/catch.hpp' file not found''

Any help would be much appreciated.

waitaria

comment created time in 16 hours

issue openedcatchorg/Catch2

fatal error: 'catch2/catch.hpp' file not found on macOS Big Sur after install with brew

Describe the bug A clear and concise description of what the bug is.

Expected behavior A clear and concise description of what you expected to happen.

Reproduction steps Steps to reproduce the bug. <!-- Usually this means a small and self-contained piece of code that uses Catch and specifying compiler flags if relevant. -->

Platform information: <!-- Fill in any extra information that might be important for your issue. -->

  • OS: Windows NT
  • Compiler+version: GCC v2.9.5
  • Catch version: v1.2.3

Additional context Add any other context about the problem here.

created time in 16 hours

issue commentcatchorg/Catch2

inconsistent semicolon expansion in catch_discover_tests

Ah, sorry, my bad! I failed to realize this is related to CMake, not the hpp file.

georg-emg

comment created time in 3 days

issue commentcatchorg/Catch2

Test type and value at once

Presumably SomeType would be decltype(expected).

Maybe. Maybe not. Depends on how you came up with expected, and since Equals already exists and supports cross-type comparison (its argument and what it receives can be different type, as long as there is == that accepts them), expected might be different type than the one you want to get. Also see the problems with whether you want cv-qualified type comparison or not, and so on...

If someone shows me good arguments for what the implementation of HasType should do to make it both expert friendly and common-user-non-surprising, I would add it to first party provided matchers. However, I currently do not know of such arguments, so I want to avoid implementing it and potentially having to keep around bad implementation for legacy reasons.

Hopefully there is a way that the type can be tested statically.

You can static_assert inside HasType::match, but my experience is that I might not always want my type tests compilation failures, which is why STATIC_REQUIRE can be switched between checking at runtime and checking during compilation.

johnmcfarlane

comment created time in 3 days

issue commentcatchorg/Catch2

global settings are changed when configuring devel branch as a subproject

Nothing to do with me, the fix #2203 caused autoclose to trigger. 😃

claremacrae

comment created time in 3 days

IssuesEvent

issue commentcatchorg/Catch2

inconsistent semicolon expansion in catch_discover_tests

@Minoru Thanks, but the fix is merged into v2 via #2216. However the discussion for the fix was in #2215, so I linked that one in the release notes.

georg-emg

comment created time in 3 days

issue commentcatchorg/Catch2

inconsistent semicolon expansion in catch_discover_tests

This issue is mentioned in the changelog for 2.13.6, but the PR that fixed it (https://github.com/catchorg/Catch2/pull/2215) is actually merged into develop branch, not 2.x, so the fix is absent from 2.13.6 release. No big deal (to me), just letting you know, @horenmar.

georg-emg

comment created time in 3 days

issue commentcatchorg/Catch2

global settings are changed when configuring devel branch as a subproject

@horenmar Thanks for merging - unfortunately this needs to be re-opened, because the #1986 changes were only made on the old branch.

Until they are ported to devel - which I was offering to do above - this problem still exists on devel.

claremacrae

comment created time in 3 days

issue commentcatchorg/Catch2

Cannot compile with REQUIRE_THROWS_MATCHES

@nrwahl2 The construction Contains("blah") is fine. The problem is that you get a String matcher, whose match method expects std::string as an argument. If you use REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher), the constructed matcher must accept ExceptionType as the argument to its match method.

whatsthecraic

comment created time in 3 days

issue commentcatchorg/Catch2

Catch single Header is not working

Duplicate, fixed in today's release.

Umong51

comment created time in 3 days

push eventcatchorg/Catch2

Clare Macrae

commit sha 2dc5a5f402831a659681b6e7c1ee7f7b93489a82

Prepare to prevent Catch2 v3's tests from being run, and CTest targets from being added, if Catch2 is configured as a sub-project. (#2205) This commit fixes issue that happens if the project above us uses the same variable name, thus confusing our script which see the variable scoped from the project including Catch2, rather than ours See #2202

view details

push time in 3 days

PR merged catchorg/Catch2

Prepare to prevent Catch2 v3's tests from being run, and CTest targets from being added, if Catch2 is configured as a sub-project. Building and Packaging

Description

What: Prevent Catch2 v3's tests from setting NOT_SUBPROJECT to ON when running as a sub-project.

Why: In projects that use Catch2 via add_subdirectory or FetchContent, this prevents the IDE's lists of targets fro being cluttered up with all CTest's targets - and it also makes CLion's "Run all CTest targets" a lot more useful, as it then only runs the user's tests, and not Catc2 ones as well.

NOTE This does not fully prevent the #2202 problem from occurring, when using Catch2's devel branch, as the fixes in PR #1986 have not yet been ported to devel - that is the subject of #2203.

GitHub Issues

See #2202.

Once this PR is merged, I'll create a separate PR to fix #2203.

Also, there as a separate PR for the v2.x branch: #2204

+2 -0

2 comments

1 changed file

claremacrae

pr closed time in 3 days

issue closedcatchorg/Catch2

global settings are changed when configuring devel branch as a subproject

This text is taken straight from the PR #1986

When adding Catch2 as a subdirectory, a couple of choices in the main CMakeLists.txt file end up having a global effect:

  • The USE_FOLDERS property is global; setting it affects the entire workspace.
  • Including the CTest module will cause the generation of several new targets.

I intend to port the #1986 changes over to the devel branch.

closed time in 3 days

claremacrae

issue closedcatchorg/Catch2

[dis]engage_platform declarations mismatch with mingw crosscompiler

Describe the bug Using catch.hpp with mingw crosscompiler leads to compilation errors:

In file included from main.cpp:4:
single_include/catch2/catch.hpp:10755:5: error: no declaration matches ‘int Catch::FatalConditionHandler::engage_platform()’
10755 |     FatalConditionHandler::engage_platform() {}
      |     ^~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:8007:14: note: candidate is: ‘void Catch::FatalConditionHandler::engage_platform()’
 8007 |         void engage_platform();
      |              ^~~~~~~~~~~~~~~
single_include/catch2/catch.hpp:8001:11: note: ‘class Catch::FatalConditionHandler’ defined here
 8001 |     class FatalConditionHandler {
      |           ^~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:10756:5: error: no declaration matches ‘int Catch::FatalConditionHandler::disengage_platform()’
10756 |     FatalConditionHandler::disengage_platform() {}
      |     ^~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:8008:14: note: candidate is: ‘void Catch::FatalConditionHandler::disengage_platform()’
 8008 |         void disengage_platform();
      |              ^~~~~~~~~~~~~~~~~~
single_include/catch2/catch.hpp:8001:11: note: ‘class Catch::FatalConditionHandler’ defined here
 8001 |     class FatalConditionHandler {
      |           ^~~~~~~~~~~~~~~~~~~~~
main.cpp:6:5: error: redefinition of ‘int main(int, char**)’
    6 | int main(int argc, char* argv[]) {
      |     ^~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:17502:5: note: ‘int main(int, char**)’ previously defined here
17502 | int main (int argc, char * argv[]) {
      |     ^~~~

Expected behavior The program compiles without errors.

Reproduction steps Basically it happens when neither windows exceptions nor posix signals are handled. Program to reproduce the bug even with standard g++:

#define CATCH_CONFIG_MAIN
#define CATCH_CONFIG_NO_WINDOWS_SEH
#define CATCH_CONFIG_NO_POSIX_SIGNALS
#include <catch2/catch.hpp>

int main(int argc, char* argv[]) {
    return 0;
}

Platform information:

  • OS: Arch Linux
  • Compiler+version: x86_64-w64-mingw32-g++ (GCC) 10.1.0
  • Catch version: v2.13.5

Additional context A PR will follow in few minutes.

closed time in 3 days

mbeniamino

issue closedcatchorg/Catch2

there is no way how to enable C++17 features in the static build (3.0 preview 3 and devel too)

Describe the bug If I'm using static build and can't touch catch2 source code / directory, I'm unable to enable c++17 mode. And when I'm using the static build I'm getting link errors like:

Undefined symbols for architecture x86_64:
  "Catch::StringMaker<std::byte, void>::convert(std::byte)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::stringify<std::byte>(std::byte const&) in hash.cpp.o

Expected behavior There should be a way how to ask the static build to be build in 17 mode or even better, the static build should be build in 17 mode, and only headers should enable/disable features..

Reproduction steps Steps to reproduce the bug.

#include <catch2/catch_test_macros.hpp>
#include <cstddef>
#include <array>

TEST_CASE("problem") {
	std::array<std::byte, 4> arr{};
	REQUIRE(arr[0] == std::byte{0});
}

and link it against Catch2::Catch2WithMain without setting -DCMAKE_CXX_STANDARD=17 globally and mark your target as target_compile_features(target_name INTERFACE cxx_std_17) then you will get a link error complaining about missing std::string StringMaker<std::byte>::convert(std::byte value)

Platform information: <!-- Fill in any extra information that might be important for your issue. -->

  • OS: macOS 11.3
  • Compiler+version: cmake 3.19.3
  • Catch version: 3.0 preview 3 and devel commit e8cdfdca87ebacd993befdd08ea6aa7e8068ef3d

Additional context Personally think that the static library should be build without highest possible standard switch available.

closed time in 3 days

hanickadot

issue commentcatchorg/Catch2

there is no way how to enable C++17 features in the static build (3.0 preview 3 and devel too)

So, the problem here is two-fold.

  1. Fundamentally, C++ does not support mixing libraries/objects that were compiled using different settings, or with different compilers, or against different version of libraries. Doing so is a quick way to get into the IF;NDR territory, e.g. via odr violation.
  2. CMake only propagates use requirements (e.g. standard library) in one direction, from depencies to their dependees. This is sufficient for things like library's include directories and link dependencies, but wholly insufficient for handling things like target C++ standard, which needs to be the same across all parts of a binary artifact.

What Catch2 currently does is to declare usage of C++14, so that if a project depends on it, it will be compiled with at least C++14. I think this is wrong for long term usage, but it is convenient to get quickly started. However, if you target a newer standard than C++14, you need to ensure that Catch2 also compiles against that standard, either by manually adding the C++17 feature to the Catch2 target, or by telling CMake to use the newer standard globally (DCMAKE_CXX_STANDARD=17 from command line, orset(CMAKE_CXX_STANDARD 17)` from the CMakeLists.txt).

The reason to prefer the latter approach is that if you have multiple dependencies, say you also want to use the excellent fmtlib, you will not have to change them separately, which you would have to do with the former approach.

hanickadot

comment created time in 3 days

created tagcatchorg/Catch2

tagv2.13.6

A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)

created time in 3 days

push eventcatchorg/Catch2

Martin Hořeňovský

commit sha 5c88067bd339465513af4aec606bd2292f1b594a

v2.13.6

view details

push time in 3 days

issue commentcatchorg/Catch2

GIVEN section in a function not executed

Hi can I solve this issue if I allowed please

kahnon

comment created time in 3 days

push eventcatchorg/Catch2

Georg Schwab

commit sha 86a4d704bcf1003f1726957c22f9eb9905f021aa

fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214)

view details

push time in 3 days

PR merged catchorg/Catch2

fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214) Contrib

Description

Changed the parameter parsing in the function add_command in CatchAddTests.cmake so that parameters that contain semicolons are not split into several arguments in the generated *_tests.cmake file. This fixes broken tests for targets whose cross-compiling generators contain arguments with escaped semicolons.

GitHub Issues

Closes #2214

+4 -1

1 comment

1 changed file

georg-emg

pr closed time in 3 days

push eventcatchorg/Catch2

Georg Schwab

commit sha 04166514feec057540e4835c9f6636e6ad47721d

fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214)

view details

push time in 3 days

PR merged catchorg/Catch2

fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214) Contrib

Description

Changed the parameter parsing in the function add_command in CatchAddTests.cmake so that parameters that contain semicolons are not split into several arguments in the generated *_tests.cmake file. This fixes broken tests for targets whose cross-compiling generators contain arguments with escaped semicolons.

GitHub Issues

Closes #2214

+4 -1

3 comments

1 changed file

georg-emg

pr closed time in 3 days

issue closedcatchorg/Catch2

inconsistent semicolon expansion in catch_discover_tests

When using the cmake command catch_discover_tests on a target with a property CROSSCOMPILING_EMULATOR, catch2 will use the emulator to discover and execute tests. If one of the parameters of the cross compiling emulator contains an escaped semicolon, however, the behaviour is inconsistent between the test discovery and the test execution. When running the test app to discover the tests, escaped semicolons are correctly turned into plain semicolons. When the tests are then run using ctest, however, escaped semicolons are falsely interpreted as separators between individual command line parameters.

Example:

consider the following cmake code fragment for a Windows test app:

add_executable(myTestApp test.cpp)
set_target_properties(myTestApp PROPERTIES CROSSCOMPILING_EMULATOR "${CMAKE_COMMAND};-E;env;PATH=C:\SomeDirectory\;C:\SomeOtherDirectory")
catch_discover_tests(myTestApp)

This will run myTestApp.exe as:

cmake.exe -E env PATH=C:\SomeDirectory;C:\SomeOtherDirectory myTestApp.exe --list-test-names-only

however, the generated include file myTestApp_tests-xxxxxxx.cmakethat contains the cmake tests, will contain lines in the form:

add_test(some_test_name cmake.exe -E env [==[PATH=C:\SomeDirectory]==] [==[C:\SomeOtherDirectory]==] myTestApp.exe some_test_name)
#                                                                     ^ Note the wrongly split argument here

instead of:

add_test(some_test_name cmake.exe -E env [==[PATH=C:\SomeDirectory;C:\SomeOtherDirectory]==] myTestApp.exe some_test_name)
#                                                                 ^ There should be a semicolon like shown here

closed time in 3 days

georg-emg

Pull request review commentcatchorg/Catch2

fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214)

 set(tests)  function(add_command NAME)   set(_args "")-  foreach(_arg ${ARGN})+  # use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments+  math(EXPR _last_arg ${ARGC}-1)+  foreach(_n RANGE 1 ${_last_arg})

Thanks for testing it, also goddamit CMake.

georg-emg

comment created time in 3 days

Pull request review commentcatchorg/Catch2

fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214)

 set(tests)  function(add_command NAME)   set(_args "")-  foreach(_arg ${ARGN})+  # use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments+  math(EXPR _last_arg ${ARGC}-1)+  foreach(_n RANGE 1 ${_last_arg})

You would think so, but is actually doesn't work. ARGV and ARGN split arguments that contain semicolons into multiple entries, as demonstrated by the following cmake script:

function(test_arguments)
	message("using \"IN LISTS ARGV\" (incorrect):")
	foreach(arg IN LISTS ARGV)
		message("  arg=${arg}")
	endforeach()

	message("using \"ARGV0..ARGVn\" (correct):")
	math(EXPR last_arg ${ARGC}-1)
	foreach(n RANGE 0 ${last_arg})
		set(arg "${ARGV${n}}")
		message("  arg=${arg}")
	endforeach()
endfunction(test_arguments)

set (arguments "one;two\;three;four")

test_arguments(${arguments })

which outputs:

using "IN LISTS ARGV" (incorrect):
  arg=one
  arg=two
  arg=three
  arg=four
using "ARGV0..ARGVn" (correct):
  arg=one
  arg=two;three
  arg=four

The second output is what we need. I originally thought foreach(_arg IN LISTS ARGN) would word as well, but no such luck.

georg-emg

comment created time in 3 days