[{"data":1,"prerenderedAt":764},["ShallowReactive",2],{"doc-limitations":3},{"id":4,"title":5,"body":6,"description":80,"extension":756,"meta":757,"navigation":391,"path":758,"seo":759,"slug":760,"source":761,"stem":762,"__hash__":763},"docs\u002Fdocs\u002Flimitations.md","Known limitations",{"type":7,"value":8,"toc":740},"minimark",[9,50,54,57,62,67,74,206,213,290,294,303,307,314,318,321,325,328,332,335,338,348,356,360,363,367,374,445,452,517,523,531,535,557,692,701,705,718,729,736],[10,11,12],"blockquote",{},[13,14,15,19,20,24,25,28,29,32,33,36,37,36,40,43,44,49],"p",{},[16,17,18],"strong",{},"Catch3 compatibility reference:"," This page describes the test-writing API Catch3 shares with Catch2: the macros, such as ",[21,22,23],"code",{},"TEST_CASE"," and ",[21,26,27],{},"REQUIRE",", and the ",[21,30,31],{},"Catch::"," namespace keep Catch2's names. Headers and build names are Catch3's own (",[21,34,35],{},"\u003CProgmasoft\u002FCatch3\u002FTestMacros.hpp>",", ",[21,38,39],{},"find_package(Catch3)",[21,41,42],{},"Catch3::Catch3WithMain","). See ",[45,46,48],"a",{"href":47},"\u002Fdocs\u002Fprogmasoft-catch3\u002F","Catch3 additions"," for Progmasoft APIs.",[51,52,5],"h1",{"id":53},"known-limitations",[13,55,56],{},"Over time, some limitations of Catch2 emerged. Some of these are due\nto implementation details that cannot be easily changed, some of these\nare due to lack of development resources on our part, and some of these\nare due to plain old 3rd party bugs.",[58,59,61],"h2",{"id":60},"implementation-limits","Implementation limits",[63,64,66],"h3",{"id":65},"sections-nested-in-loops","Sections nested in loops",[13,68,69,70,73],{},"If you are using ",[21,71,72],{},"SECTION","s inside loops, you have to create them with\ndifferent name per loop's iteration. The recommended way to do so is to\nincorporate the loop's counter into section's name, like so:",[75,76,81],"pre",{"className":77,"code":78,"language":79,"meta":80,"style":80},"language-cpp shiki shiki-themes github-dark","TEST_CASE( \"Looped section\" ) {\n    for (char i = '0'; i \u003C '5'; ++i) {\n        SECTION(std::string(\"Looped section \") + i) {\n            SUCCEED( \"Everything is OK\" );\n        }\n    }\n}\n","cpp","",[21,82,83,102,142,174,188,194,200],{"__ignoreMap":80},[84,85,88,91,95,99],"span",{"class":86,"line":87},"line",1,[84,89,23],{"class":90},"svObZ",[84,92,94],{"class":93},"s95oV","( ",[84,96,98],{"class":97},"sU2Wk","\"Looped section\"",[84,100,101],{"class":93}," ) {\n",[84,103,105,109,112,115,118,121,124,127,130,133,136,139],{"class":86,"line":104},2,[84,106,108],{"class":107},"snl16","    for",[84,110,111],{"class":93}," (",[84,113,114],{"class":107},"char",[84,116,117],{"class":93}," i ",[84,119,120],{"class":107},"=",[84,122,123],{"class":97}," '0'",[84,125,126],{"class":93},"; i ",[84,128,129],{"class":107},"\u003C",[84,131,132],{"class":97}," '5'",[84,134,135],{"class":93},"; ",[84,137,138],{"class":107},"++",[84,140,141],{"class":93},"i) {\n",[84,143,145,148,151,154,157,160,162,165,168,171],{"class":86,"line":144},3,[84,146,147],{"class":90},"        SECTION",[84,149,150],{"class":93},"(",[84,152,153],{"class":90},"std",[84,155,156],{"class":93},"::",[84,158,159],{"class":90},"string",[84,161,150],{"class":93},[84,163,164],{"class":97},"\"Looped section \"",[84,166,167],{"class":93},") ",[84,169,170],{"class":107},"+",[84,172,173],{"class":93}," i) {\n",[84,175,177,180,182,185],{"class":86,"line":176},4,[84,178,179],{"class":90},"            SUCCEED",[84,181,94],{"class":93},[84,183,184],{"class":97},"\"Everything is OK\"",[84,186,187],{"class":93}," );\n",[84,189,191],{"class":86,"line":190},5,[84,192,193],{"class":93},"        }\n",[84,195,197],{"class":86,"line":196},6,[84,198,199],{"class":93},"    }\n",[84,201,203],{"class":86,"line":202},7,[84,204,205],{"class":93},"}\n",[13,207,208,209,212],{},"or with a ",[21,210,211],{},"DYNAMIC_SECTION"," macro (that was made for exactly this purpose):",[75,214,216],{"className":77,"code":215,"language":79,"meta":80,"style":80},"TEST_CASE( \"Looped section\" ) {\n    for (char i = '0'; i \u003C '5'; ++i) {\n        DYNAMIC_SECTION( \"Looped section \" \u003C\u003C i) {\n            SUCCEED( \"Everything is OK\" );\n        }\n    }\n}\n",[21,217,218,228,254,268,278,282,286],{"__ignoreMap":80},[84,219,220,222,224,226],{"class":86,"line":87},[84,221,23],{"class":90},[84,223,94],{"class":93},[84,225,98],{"class":97},[84,227,101],{"class":93},[84,229,230,232,234,236,238,240,242,244,246,248,250,252],{"class":86,"line":104},[84,231,108],{"class":107},[84,233,111],{"class":93},[84,235,114],{"class":107},[84,237,117],{"class":93},[84,239,120],{"class":107},[84,241,123],{"class":97},[84,243,126],{"class":93},[84,245,129],{"class":107},[84,247,132],{"class":97},[84,249,135],{"class":93},[84,251,138],{"class":107},[84,253,141],{"class":93},[84,255,256,259,261,263,266],{"class":86,"line":144},[84,257,258],{"class":90},"        DYNAMIC_SECTION",[84,260,94],{"class":93},[84,262,164],{"class":97},[84,264,265],{"class":107}," \u003C\u003C",[84,267,173],{"class":93},[84,269,270,272,274,276],{"class":86,"line":176},[84,271,179],{"class":90},[84,273,94],{"class":93},[84,275,184],{"class":97},[84,277,187],{"class":93},[84,279,280],{"class":86,"line":190},[84,281,193],{"class":93},[84,283,284],{"class":86,"line":196},[84,285,199],{"class":93},[84,287,288],{"class":86,"line":202},[84,289,205],{"class":93},[63,291,293],{"id":292},"tests-might-be-run-again-if-last-section-fails","Tests might be run again if last section fails",[13,295,296,297,299,300,302],{},"If the last section in a test fails, it might be run again. This is because\nCatch2 discovers ",[21,298,72],{},"s dynamically, as they are about to run, and\nif the last section in test case is aborted during execution (e.g. via\nthe ",[21,301,27],{}," family of macros), Catch2 does not know that there are no\nmore sections in that test case and must run the test case again.",[63,304,306],{"id":305},"mingwcygwin-compilation-linking-is-extremely-slow","MinGW\u002FCygWin compilation (linking) is extremely slow",[13,308,309,310,313],{},"Compiling Catch2 with MinGW can be exceedingly slow, especially during\nthe linking step. As far as we can tell, this is caused by deficiencies\nin its default linker. If you can tell MinGW to instead use lld, via\n",[21,311,312],{},"-fuse-ld=lld",", the link time should drop down to reasonable length\nagain.",[58,315,317],{"id":316},"features","Features",[13,319,320],{},"This section outlines some missing features, what is their status and their possible workarounds.",[63,322,324],{"id":323},"process-isolation-in-a-test","Process isolation in a test",[13,326,327],{},"Catch does not support running tests in isolated (forked) processes. While this might in the future, the fact that Windows does not support forking and only allows full-on process creation and the desire to keep code as similar as possible across platforms, mean that this is likely to take significant development time, that is not currently available.",[63,329,331],{"id":330},"running-multiple-tests-in-parallel","Running multiple tests in parallel",[13,333,334],{},"Catch2 keeps test execution in one process strictly serial, and there\nare no plans to change this. If you find yourself with a test suite\nthat takes too long to run and you want to make it parallel, you have\nto run multiple processes side by side.",[13,336,337],{},"There are 2 basic ways to do that,",[339,340,341,345],"ul",{},[342,343,344],"li",{},"you can split your tests into multiple binaries, and run those binaries\nin parallel",[342,346,347],{},"you can run the same test binary multiple times, but run a different\nsubset of the tests in each process",[13,349,350,351,355],{},"There are multiple ways to achieve the latter, the easiest way is to use\n",[45,352,354],{"href":353},"\u002Fdocs\u002Fcommand-line\u002F#test-sharding","test sharding",".",[58,357,359],{"id":358},"_3rd-party-bugs","3rd party bugs",[13,361,362],{},"This section outlines known bugs in 3rd party components (this means compilers, standard libraries, standard runtimes).",[63,364,366],{"id":365},"visual-studio-2017-raw-string-literal-in-assert-fails-to-compile","Visual Studio 2017 -- raw string literal in assert fails to compile",[13,368,369,370,373],{},"There is a known bug in Visual Studio 2017 (VC 15), that causes compilation\nerror when preprocessor attempts to stringize a raw string literal\n(",[21,371,372],{},"#"," preprocessor directive is applied to it). This snippet is sufficient\nto trigger the compilation error:",[75,375,377],{"className":77,"code":376,"language":79,"meta":80,"style":80},"#include \u003CProgmasoft\u002FCatch3\u002FTestMacros.hpp>\n\nTEST_CASE(\"test\") {\n    CHECK(std::string(R\"(\"\\)\") == \"\\\"\\\\\");\n}\n",[21,378,379,387,393,405,441],{"__ignoreMap":80},[84,380,381,384],{"class":86,"line":87},[84,382,383],{"class":107},"#include",[84,385,386],{"class":97}," \u003CProgmasoft\u002FCatch3\u002FTestMacros.hpp>\n",[84,388,389],{"class":86,"line":104},[84,390,392],{"emptyLinePlaceholder":391},true,"\n",[84,394,395,397,399,402],{"class":86,"line":144},[84,396,23],{"class":90},[84,398,150],{"class":93},[84,400,401],{"class":97},"\"test\"",[84,403,404],{"class":93},") {\n",[84,406,407,410,412,414,416,418,420,423,425,428,431,435,438],{"class":86,"line":176},[84,408,409],{"class":90},"    CHECK",[84,411,150],{"class":93},[84,413,153],{"class":90},[84,415,156],{"class":93},[84,417,159],{"class":90},[84,419,150],{"class":93},[84,421,422],{"class":97},"R\"(\"\\)\"",[84,424,167],{"class":93},[84,426,427],{"class":107},"==",[84,429,430],{"class":97}," \"",[84,432,434],{"class":433},"sDLfK","\\\"\\\\",[84,436,437],{"class":97},"\"",[84,439,440],{"class":93},");\n",[84,442,443],{"class":86,"line":190},[84,444,205],{"class":93},[13,446,447,448,451],{},"Catch2 provides a workaround, by letting the user disable stringification\nof the original expression by defining ",[21,449,450],{},"CATCH_CONFIG_DISABLE_STRINGIFICATION",",\nlike so:",[75,453,455],{"className":77,"code":454,"language":79,"meta":80,"style":80},"#define CATCH_CONFIG_DISABLE_STRINGIFICATION\n#include \u003CProgmasoft\u002FCatch3\u002FTestMacros.hpp>\n\nTEST_CASE(\"test\") {\n    CHECK(std::string(R\"(\"\\)\") == \"\\\"\\\\\");\n}\n",[21,456,457,465,471,475,485,513],{"__ignoreMap":80},[84,458,459,462],{"class":86,"line":87},[84,460,461],{"class":107},"#define",[84,463,464],{"class":90}," CATCH_CONFIG_DISABLE_STRINGIFICATION\n",[84,466,467,469],{"class":86,"line":104},[84,468,383],{"class":107},[84,470,386],{"class":97},[84,472,473],{"class":86,"line":144},[84,474,392],{"emptyLinePlaceholder":391},[84,476,477,479,481,483],{"class":86,"line":176},[84,478,23],{"class":90},[84,480,150],{"class":93},[84,482,401],{"class":97},[84,484,404],{"class":93},[84,486,487,489,491,493,495,497,499,501,503,505,507,509,511],{"class":86,"line":190},[84,488,409],{"class":90},[84,490,150],{"class":93},[84,492,153],{"class":90},[84,494,156],{"class":93},[84,496,159],{"class":90},[84,498,150],{"class":93},[84,500,422],{"class":97},[84,502,167],{"class":93},[84,504,427],{"class":107},[84,506,430],{"class":97},[84,508,434],{"class":433},[84,510,437],{"class":97},[84,512,440],{"class":93},[84,514,515],{"class":86,"line":196},[84,516,205],{"class":93},[13,518,519],{},[520,521,522],"em",{},"Do note that this changes the output:",[75,524,529],{"className":525,"code":527,"language":528},[526],"language-text","catchwork\\test1.cpp(6):\nPASSED:\n  CHECK( Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION )\nwith expansion:\n  \"\"\\\" == \"\"\\\"\n","text",[21,530,527],{"__ignoreMap":80},[63,532,534],{"id":533},"clangg-skipping-leaf-sections-after-an-exception","Clang\u002FG++ -- skipping leaf sections after an exception",[13,536,537,538,24,541,544,545,548,549,552,553,556],{},"Some versions of ",[21,539,540],{},"libc++",[21,542,543],{},"libstdc++"," (or their runtimes) have a bug with ",[21,546,547],{},"std::uncaught_exception()"," getting stuck returning ",[21,550,551],{},"true"," after rethrow, even if there are no active exceptions. One such case is this snippet, which skipped the sections \"a\" and \"b\", when compiled against ",[21,554,555],{},"libcxxrt"," from the master branch",[75,558,560],{"className":77,"code":559,"language":79,"meta":80,"style":80},"#include \u003CProgmasoft\u002FCatch3\u002FTestMacros.hpp>\n\nTEST_CASE(\"a\") {\n    CHECK_THROWS(throw 3);\n}\n\nTEST_CASE(\"b\") {\n    int i = 0;\n    SECTION(\"a\") { i = 1; }\n    SECTION(\"b\") { i = 2; }\n    CHECK(i > 0);\n}\n",[21,561,562,568,572,583,598,602,606,617,633,654,672,687],{"__ignoreMap":80},[84,563,564,566],{"class":86,"line":87},[84,565,383],{"class":107},[84,567,386],{"class":97},[84,569,570],{"class":86,"line":104},[84,571,392],{"emptyLinePlaceholder":391},[84,573,574,576,578,581],{"class":86,"line":144},[84,575,23],{"class":90},[84,577,150],{"class":93},[84,579,580],{"class":97},"\"a\"",[84,582,404],{"class":93},[84,584,585,588,590,593,596],{"class":86,"line":176},[84,586,587],{"class":90},"    CHECK_THROWS",[84,589,150],{"class":93},[84,591,592],{"class":107},"throw",[84,594,595],{"class":433}," 3",[84,597,440],{"class":93},[84,599,600],{"class":86,"line":190},[84,601,205],{"class":93},[84,603,604],{"class":86,"line":196},[84,605,392],{"emptyLinePlaceholder":391},[84,607,608,610,612,615],{"class":86,"line":202},[84,609,23],{"class":90},[84,611,150],{"class":93},[84,613,614],{"class":97},"\"b\"",[84,616,404],{"class":93},[84,618,620,623,625,627,630],{"class":86,"line":619},8,[84,621,622],{"class":107},"    int",[84,624,117],{"class":93},[84,626,120],{"class":107},[84,628,629],{"class":433}," 0",[84,631,632],{"class":93},";\n",[84,634,636,639,641,643,646,648,651],{"class":86,"line":635},9,[84,637,638],{"class":90},"    SECTION",[84,640,150],{"class":93},[84,642,580],{"class":97},[84,644,645],{"class":93},") { i ",[84,647,120],{"class":107},[84,649,650],{"class":433}," 1",[84,652,653],{"class":93},"; }\n",[84,655,657,659,661,663,665,667,670],{"class":86,"line":656},10,[84,658,638],{"class":90},[84,660,150],{"class":93},[84,662,614],{"class":97},[84,664,645],{"class":93},[84,666,120],{"class":107},[84,668,669],{"class":433}," 2",[84,671,653],{"class":93},[84,673,675,677,680,683,685],{"class":86,"line":674},11,[84,676,409],{"class":90},[84,678,679],{"class":93},"(i ",[84,681,682],{"class":107},">",[84,684,629],{"class":433},[84,686,440],{"class":93},[84,688,690],{"class":86,"line":689},12,[84,691,205],{"class":93},[13,693,694,695,697,698,700],{},"If you are seeing a problem like this, i.e. weird test paths that trigger only under Clang with ",[21,696,540],{},", or only under very specific version of ",[21,699,543],{},", it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library.",[63,702,704],{"id":703},"visual-studio-2022-cant-compile-assertion-with-the-spaceship-operator","Visual Studio 2022 -- can't compile assertion with the spaceship operator",[13,706,707,717],{},[45,708,712,713,716],{"href":709,"rel":710},"https:\u002F\u002Feel.is\u002Fc++draft\u002Fcmp#categories.pre-3",[711],"nofollow","The C++ standard requires that ",[21,714,715],{},"std::foo_ordering"," is only comparable with\na literal 0",". There are\nmultiple strategies a stdlib implementation can take to achieve this, and\nMSVC's STL has changed the strategy they use between two releases of VS 2022.",[13,719,720,721,724,725,728],{},"With the new strategy, ",[21,722,723],{},"REQUIRE((a \u003C=> b) == 0)"," no longer compiles under\nMSVC. Note that Catch2 can compile code using MSVC STL's new strategy,\nbut only when compiled with a C++20 conforming compiler. MSVC is currently\nnot conformant enough, but ",[21,726,727],{},"clang-cl"," will compile the assertion above\nusing MSVC STL without problem.",[13,730,731,355],{},[45,732,735],{"href":733,"rel":734},"https:\u002F\u002Fgodbolt.org\u002Fz\u002FKG9obzdvE",[711],"This change got in with MSVC v19.37",[737,738,739],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":80,"searchDepth":104,"depth":104,"links":741},[742,747,751],{"id":60,"depth":104,"text":61,"children":743},[744,745,746],{"id":65,"depth":144,"text":66},{"id":292,"depth":144,"text":293},{"id":305,"depth":144,"text":306},{"id":316,"depth":104,"text":317,"children":748},[749,750],{"id":323,"depth":144,"text":324},{"id":330,"depth":144,"text":331},{"id":358,"depth":104,"text":359,"children":752},[753,754,755],{"id":365,"depth":144,"text":366},{"id":533,"depth":144,"text":534},{"id":703,"depth":144,"text":704},"md",{},"\u002Fdocs\u002Flimitations",{"title":5,"description":80},"limitations","docs\u002Flimitations.md","docs\u002Flimitations","rPmJSCV0wuTBNd6a_H0BC14j_uXvmLah7Vu_dCyyYPY",1794961592197]