[{"data":1,"prerenderedAt":276},["ShallowReactive",2],{"doc-faq":3},{"id":4,"title":5,"body":6,"description":254,"extension":267,"meta":268,"navigation":269,"path":270,"seo":271,"slug":272,"source":273,"stem":274,"__hash__":275},"docs\u002Fdocs\u002Ffaq.md","Frequently Asked Questions (FAQ)",{"type":7,"value":8,"toc":253},"minimark",[9,50,54,120,124,136,139,152,155,158,161,164,167,170,173,176,179,187,190,204,207,210,213,220,230,235,240],[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},"frequently-asked-questions-faq",[13,55,56,59,62,66,68,72,74,78,80,84,86,90,92,96,98,102,104,108,110,118],{},[16,57,58],{},"Contents",[60,61],"br",{},[45,63,65],{"href":64},"#how-do-i-run-global-setupteardown-only-if-tests-will-be-run","How do I run global setup\u002Fteardown only if tests will be run?",[60,67],{},[45,69,71],{"href":70},"#how-do-i-clean-up-global-state-between-running-different-tests","How do I clean up global state between running different tests?",[60,73],{},[45,75,77],{"href":76},"#why-cannot-i-derive-from-the-built-in-reporters","Why cannot I derive from the built-in reporters?",[60,79],{},[45,81,83],{"href":82},"#what-is-catch2s-abi-stability-policy","What is Catch2's ABI stability policy?",[60,85],{},[45,87,89],{"href":88},"#what-is-catch2s-api-stability-policy","What is Catch2's API stability policy?",[60,91],{},[45,93,95],{"href":94},"#does-catch2-support-running-tests-in-parallel","Does Catch2 support running tests in parallel?",[60,97],{},[45,99,101],{"href":100},"#can-i-compile-catch2-into-a-dynamic-library","Can I compile Catch2 into a dynamic library?",[60,103],{},[45,105,107],{"href":106},"#what-repeatability-guarantees-does-catch2-provide","What repeatability guarantees does Catch2 provide?",[60,109],{},[45,111,113,114,117],{"href":112},"#my-build-cannot-find-catch2catch_user_confighpp-how-can-i-fix-it","My build cannot find ",[21,115,116],{},"Progmasoft\u002FCatch3\u002FUserConfig.hpp",", how can I fix it?",[60,119],{},[121,122,65],"h2",{"id":123},"how-do-i-run-global-setupteardown-only-if-tests-will-be-run",[13,125,126,127,131,132,135],{},"Write a custom ",[45,128,130],{"href":129},"\u002Fdocs\u002Fevent-listeners\u002F","event listener"," and place the\nglobal setup\u002Fteardown code into the ",[21,133,134],{},"testRun*"," events.",[121,137,71],{"id":138},"how-do-i-clean-up-global-state-between-running-different-tests",[13,140,126,141,143,144,147,148,151],{},[45,142,130],{"href":129}," and place the\ncleanup code into either ",[21,145,146],{},"testCase*"," or ",[21,149,150],{},"testCasePartial*"," events,\ndepending on how often the cleanup needs to happen.",[121,153,77],{"id":154},"why-cannot-i-derive-from-the-built-in-reporters",[13,156,157],{},"They are not made to be overridden, in that we do not attempt to maintain\na consistent internal state if a member function is overridden, and by\nforbidding users from using them as a base class, we can refactor them\nas needed later.",[121,159,83],{"id":160},"what-is-catch2s-abi-stability-policy",[13,162,163],{},"The bundled Catch2-compatible engine provides no ABI stability guarantee.\nIts C++ interfaces should be compiled with a consistent compiler and build\nconfiguration. The Progmasoft C++17 extension library does not currently\npromise a stable binary ABI either.",[13,165,166],{},"Catch2 is not designed to be distributed as dynamic library, and you\nshould really be able to compile everything with the same compiler binary.",[121,168,89],{"id":169},"what-is-catch2s-api-stability-policy",[13,171,172],{},"The historical Catch2 compatibility API retains its upstream names and\nsemantics where this fork has not explicitly documented a difference. Catch3\ndoes not claim that its independently developed Progmasoft extensions inherit\nCatch2's upstream release or API-stability policy. Verify the extension API\nagainst the Catch3 version you build.",[121,174,95],{"id":175},"does-catch2-support-running-tests-in-parallel",[13,177,178],{},"Not natively, no. We see running tests in parallel as the job of an\nexternal test runner, that can also run them in separate processes,\nsupport test execution timeouts and so on.",[13,180,181,182,186],{},"However, Catch2 provides some tools that make the job of external test\nrunners easier. ",[45,183,185],{"href":184},"\u002Fdocs\u002Fusage-tips\u002F#parallel-tests","See the relevant section in our page on best\npractices",".",[121,188,101],{"id":189},"can-i-compile-catch2-into-a-dynamic-library",[13,191,192,193,203],{},"Yes, Catch2 supports the ",[45,194,198,199,202],{"href":195,"rel":196},"https:\u002F\u002Fcmake.org\u002Fcmake\u002Fhelp\u002Flatest\u002Fvariable\u002FBUILD_SHARED_LIBS.html",[197],"nofollow","standard CMake ",[21,200,201],{},"BUILD_SHARED_LIBS","\noption",".\nHowever, the dynamic library support is provided as-is. Catch2 does not\nprovide API export annotations, and so you can only use it as a dynamic\nlibrary on platforms that default to public visibility, or with tooling\nsupport to force export Catch2's API.",[121,205,107],{"id":206},"what-repeatability-guarantees-does-catch2-provide",[13,208,209],{},"There are two places where it is meaningful to talk about Catch2's\nrepeatability guarantees without taking into account user-provided\ncode. First one is in the test case shuffling, and the second one is\nthe output from random generators.",[13,211,212],{},"Test case shuffling is repeatable across different platforms since v2.12.0,\nand it is also generally repeatable across versions, but we might break\nit from time to time. E.g. we broke repeatability with previous versions\nin v2.13.4 so that test cases with similar names are shuffled better.",[13,214,215,216,186],{},"Since Catch2 3.5.0 the random generators use custom distributions,\nthat should be repeatable across different platforms, with few caveats.\nFor details see the section on random generators in the ",[45,217,219],{"href":218},"\u002Fdocs\u002Fgenerators\u002F#random-number-generators-details","Generator\ndocumentation",[13,221,222,223],{},"Before this version, random generators relied on distributions from\nplatform's stdlib. We thus can provide no extra guarantee on top of the\nones given by your platform. ",[16,224,225,226,229],{},"Important: ",[21,227,228],{},"\u003Crandom>","'s distributions\nare not specified to be repeatable across different platforms.",[121,231,113,233,117],{"id":232},"my-build-cannot-find-progmasoftcatch3userconfighpp-how-can-i-fix-it",[21,234,116],{},[13,236,237,239],{},[21,238,116],{}," is a generated header that contains user\ncompile time configuration. It is generated by CMake\u002FMeson\u002FBazel during\nbuild. If you are not using either of these, your three options are to",[241,242,243,247,250],"ol",{},[244,245,246],"li",{},"Build Catch2 separately using build tool that will generate the header",[244,248,249],{},"Use the amalgamated files to build Catch2",[244,251,252],{},"Use CMake to configure a build. This will generate the header and you\ncan copy it into your own checkout of Catch2.",{"title":254,"searchDepth":255,"depth":255,"links":256},"",2,[257,258,259,260,261,262,263,264,265],{"id":123,"depth":255,"text":65},{"id":138,"depth":255,"text":71},{"id":154,"depth":255,"text":77},{"id":160,"depth":255,"text":83},{"id":169,"depth":255,"text":89},{"id":175,"depth":255,"text":95},{"id":189,"depth":255,"text":101},{"id":206,"depth":255,"text":107},{"id":232,"depth":255,"text":266},"My build cannot find Progmasoft\u002FCatch3\u002FUserConfig.hpp, how can I fix it?","md",{},true,"\u002Fdocs\u002Ffaq",{"title":5,"description":254},"faq","docs\u002Ffaq.md","docs\u002Ffaq","haY_dI9g9PmHGKkQQqTH3dDrwVN5TC8Jehu83viKKlM",1794961595052]