[{"data":1,"prerenderedAt":812},["ShallowReactive",2],{"doc-reporter-events":3},{"id":4,"title":5,"body":6,"description":189,"extension":804,"meta":805,"navigation":806,"path":807,"seo":808,"slug":53,"source":809,"stem":810,"__hash__":811},"docs\u002Fdocs\u002Freporter-events.md","Reporter events",{"type":7,"value":8,"toc":788},"minimark",[9,50,54,80,93,96,109,117,121,132,175,183,242,254,260,303,321,327,332,386,394,412,418,461,469,477,483,526,551,554,565,666,673,681,707,710,761,764,778,784],[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},"reporter-events",[13,55,56,59,62,66,68,72,74,78],{},[16,57,58],{},"Contents",[60,61],"br",{},[45,63,65],{"href":64},"#test-running-events","Test running events",[60,67],{},[45,69,71],{"href":70},"#benchmarking-events","Benchmarking events",[60,73],{},[45,75,77],{"href":76},"#miscellaneous-events","Miscellaneous events",[60,79],{},[13,81,82,83,87,88,92],{},"Reporter events are one of the customization points for user code. They\nare used by ",[45,84,86],{"href":85},"\u002Fdocs\u002Fevent-listeners\u002F","event listeners"," to perform in-process\nactions under some conditions. The reporters of Catch2 that also received\nthem were replaced by the ",[45,89,91],{"href":90},"\u002Fdocs\u002Freporters\u002F","reports"," of the Catch3 runner.",[13,94,95],{},"There are 17 events, split between 3 event groups:",[97,98,99,103,106],"ul",{},[100,101,102],"li",{},"test running events (10 events)",[100,104,105],{},"benchmarking (4 events)",[100,107,108],{},"miscellaneous (3 events)",[13,110,111,112,116],{},"Each worker process of the ",[45,113,115],{"href":114},"\u002Fdocs\u002Fprogmasoft-runner\u002F","Catch3 runner"," is a\ntest run of its own: its listeners see the events of the tests it runs.",[118,119,65],"h2",{"id":120},"test-running-events",[13,122,123,124,127,128,131],{},"Test running events are always paired so that for each ",[21,125,126],{},"fooStarting"," event,\nthere is a ",[21,129,130],{},"fooEnded"," event. This means that the 10 test running events\nconsist of 5 pairs of events:",[97,133,134,143,151,159,167],{},[100,135,136,24,139,142],{},[21,137,138],{},"testRunStarting",[21,140,141],{},"testRunEnded",",",[100,144,145,24,148,142],{},[21,146,147],{},"testCaseStarting",[21,149,150],{},"testCaseEnded",[100,152,153,24,156,142],{},[21,154,155],{},"testCasePartialStarting",[21,157,158],{},"testCasePartialEnded",[100,160,161,24,164,142],{},[21,162,163],{},"sectionStarting",[21,165,166],{},"sectionEnded",[100,168,169,24,172],{},[21,170,171],{},"assertionStarting",[21,173,174],{},"assertionEnded",[176,177,179,182],"h3",{"id":178},"testrun-events",[21,180,181],{},"testRun"," events",[184,185,190],"pre",{"className":186,"code":187,"language":188,"meta":189,"style":189},"language-cpp shiki shiki-themes github-dark","void testRunStarting( TestRunInfo const& testRunInfo );\nvoid testRunEnded( TestRunStats const& testRunStats );\n","cpp","",[21,191,192,222],{"__ignoreMap":189},[193,194,197,201,205,209,212,215,219],"span",{"class":195,"line":196},"line",1,[193,198,200],{"class":199},"snl16","void",[193,202,204],{"class":203},"svObZ"," testRunStarting",[193,206,208],{"class":207},"s95oV","( ",[193,210,211],{"class":203},"TestRunInfo",[193,213,214],{"class":199}," const&",[193,216,218],{"class":217},"s9osk"," testRunInfo",[193,220,221],{"class":207}," );\n",[193,223,225,227,230,232,235,237,240],{"class":195,"line":224},2,[193,226,200],{"class":199},[193,228,229],{"class":203}," testRunEnded",[193,231,208],{"class":207},[193,233,234],{"class":203},"TestRunStats",[193,236,214],{"class":199},[193,238,239],{"class":217}," testRunStats",[193,241,221],{"class":207},[13,243,244,245,247,248,250,251,253],{},"The ",[21,246,181],{}," events bookend the test run of one process. ",[21,249,138],{},"\nis emitted before the first test case the process executes, and\n",[21,252,141],{}," after the last.",[176,255,257,182],{"id":256},"testcase-events",[21,258,259],{},"testCase",[184,261,263],{"className":186,"code":262,"language":188,"meta":189,"style":189},"void testCaseStarting( TestCaseInfo const& testInfo );\nvoid testCaseEnded( TestCaseStats const& testCaseStats );\n",[21,264,265,284],{"__ignoreMap":189},[193,266,267,269,272,274,277,279,282],{"class":195,"line":196},[193,268,200],{"class":199},[193,270,271],{"class":203}," testCaseStarting",[193,273,208],{"class":207},[193,275,276],{"class":203},"TestCaseInfo",[193,278,214],{"class":199},[193,280,281],{"class":217}," testInfo",[193,283,221],{"class":207},[193,285,286,288,291,293,296,298,301],{"class":195,"line":224},[193,287,200],{"class":199},[193,289,290],{"class":203}," testCaseEnded",[193,292,208],{"class":207},[193,294,295],{"class":203},"TestCaseStats",[193,297,214],{"class":199},[193,299,300],{"class":217}," testCaseStats",[193,302,221],{"class":207},[13,304,244,305,307,308,312,313,316,317,320],{},[21,306,259],{}," events bookend one ",[309,310,311],"em",{},"full"," run of a specific test case.\nIndividual runs through a test case, e.g. due to ",[21,314,315],{},"SECTION","s or ",[21,318,319],{},"GENERATE","s,\nare handled by a different event.",[176,322,324,182],{"id":323},"testcasepartial-events",[21,325,326],{},"testCasePartial",[10,328,329],{},[13,330,331],{},"Introduced in Catch2 3.0.1",[184,333,335],{"className":186,"code":334,"language":188,"meta":189,"style":189},"void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber );\nvoid testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber );\n",[21,336,337,362],{"__ignoreMap":189},[193,338,339,341,344,346,348,350,352,354,357,360],{"class":195,"line":196},[193,340,200],{"class":199},[193,342,343],{"class":203}," testCasePartialStarting",[193,345,208],{"class":207},[193,347,276],{"class":203},[193,349,214],{"class":199},[193,351,281],{"class":217},[193,353,36],{"class":207},[193,355,356],{"class":199},"uint64_t",[193,358,359],{"class":217}," partNumber",[193,361,221],{"class":207},[193,363,364,366,369,372,374,376,378,380,382,384],{"class":195,"line":224},[193,365,200],{"class":199},[193,367,368],{"class":203}," testCasePartialEnded",[193,370,371],{"class":207},"(",[193,373,295],{"class":203},[193,375,214],{"class":199},[193,377,300],{"class":217},[193,379,36],{"class":207},[193,381,356],{"class":199},[193,383,359],{"class":217},[193,385,221],{"class":207},[13,387,388,307,390,393],{},[21,389,326],{},[309,391,392],{},"partial"," run of a specific test case.\nThis means that for any given test case, these events can be emitted\nmultiple times, e.g. due to multiple leaf sections.",[13,395,396,397,399,400,402,403,405,406,408,409,411],{},"In regards to nesting with ",[21,398,259],{}," events, ",[21,401,155],{},"\nwill never be emitted before the corresponding ",[21,404,147],{},", and\n",[21,407,158],{}," will always be emitted before the corresponding\n",[21,410,150],{},".",[176,413,415,182],{"id":414},"section-events",[21,416,417],{},"section",[184,419,421],{"className":186,"code":420,"language":188,"meta":189,"style":189},"void sectionStarting( SectionInfo const& sectionInfo );\nvoid sectionEnded( SectionStats const& sectionStats );\n",[21,422,423,442],{"__ignoreMap":189},[193,424,425,427,430,432,435,437,440],{"class":195,"line":196},[193,426,200],{"class":199},[193,428,429],{"class":203}," sectionStarting",[193,431,208],{"class":207},[193,433,434],{"class":203},"SectionInfo",[193,436,214],{"class":199},[193,438,439],{"class":217}," sectionInfo",[193,441,221],{"class":207},[193,443,444,446,449,451,454,456,459],{"class":195,"line":224},[193,445,200],{"class":199},[193,447,448],{"class":203}," sectionEnded",[193,450,208],{"class":207},[193,452,453],{"class":203},"SectionStats",[193,455,214],{"class":199},[193,457,458],{"class":217}," sectionStats",[193,460,221],{"class":207},[13,462,463,465,466,468],{},[21,464,417],{}," events are emitted only for active ",[21,467,315],{},"s, that is, sections\nthat are entered. Sections that are skipped in this test case run-through\ndo not cause events to be emitted.",[13,470,471],{},[309,472,473,474,476],{},"Note that test cases always contain one implicit section. The event for\nthis section is emitted after the corresponding ",[21,475,155],{},"\nevent.",[176,478,480,182],{"id":479},"assertion-events",[21,481,482],{},"assertion",[184,484,486],{"className":186,"code":485,"language":188,"meta":189,"style":189},"void assertionStarting( AssertionInfo const& assertionInfo );\nvoid assertionEnded( AssertionStats const& assertionStats );\n",[21,487,488,507],{"__ignoreMap":189},[193,489,490,492,495,497,500,502,505],{"class":195,"line":196},[193,491,200],{"class":199},[193,493,494],{"class":203}," assertionStarting",[193,496,208],{"class":207},[193,498,499],{"class":203},"AssertionInfo",[193,501,214],{"class":199},[193,503,504],{"class":217}," assertionInfo",[193,506,221],{"class":207},[193,508,509,511,514,516,519,521,524],{"class":195,"line":224},[193,510,200],{"class":199},[193,512,513],{"class":203}," assertionEnded",[193,515,208],{"class":207},[193,517,518],{"class":203},"AssertionStats",[193,520,214],{"class":199},[193,522,523],{"class":217}," assertionStats",[193,525,221],{"class":207},[13,527,244,528,530,531,533,534,537,538,540,541,24,544,547,548,550],{},[21,529,171],{}," event is emitted before the expression in the\nassertion is captured or evaluated and ",[21,532,174],{}," is emitted\nafterwards. This means that given assertion like ",[21,535,536],{},"REQUIRE(a + b == c + d)",",\nCatch2 first emits ",[21,539,171],{}," event, then ",[21,542,543],{},"a + b",[21,545,546],{},"c + d","\nare evaluated, then their results are captured, the comparison is evaluated,\nand then ",[21,549,174],{}," event is emitted.",[118,552,71],{"id":553},"benchmarking-events",[10,555,556],{},[13,557,558,564],{},[45,559,563],{"href":560,"rel":561},"https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Fissues\u002F1616",[562],"nofollow","Introduced"," in Catch2 2.9.0.",[184,566,568],{"className":186,"code":567,"language":188,"meta":189,"style":189},"void benchmarkPreparing( StringRef name ) override;\nvoid benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;\nvoid benchmarkEnded( BenchmarkStats\u003C> const& benchmarkStats ) override;\nvoid benchmarkFailed( StringRef error ) override;\n",[21,569,570,594,617,645],{"__ignoreMap":189},[193,571,572,574,577,579,582,585,588,591],{"class":195,"line":196},[193,573,200],{"class":199},[193,575,576],{"class":203}," benchmarkPreparing",[193,578,208],{"class":207},[193,580,581],{"class":203},"StringRef",[193,583,584],{"class":217}," name",[193,586,587],{"class":207}," ) ",[193,589,590],{"class":199},"override",[193,592,593],{"class":207},";\n",[193,595,596,598,601,603,606,608,611,613,615],{"class":195,"line":224},[193,597,200],{"class":199},[193,599,600],{"class":203}," benchmarkStarting",[193,602,208],{"class":207},[193,604,605],{"class":203},"BenchmarkInfo",[193,607,214],{"class":199},[193,609,610],{"class":217}," benchmarkInfo",[193,612,587],{"class":207},[193,614,590],{"class":199},[193,616,593],{"class":207},[193,618,620,622,625,627,630,633,636,639,641,643],{"class":195,"line":619},3,[193,621,200],{"class":199},[193,623,624],{"class":203}," benchmarkEnded",[193,626,208],{"class":207},[193,628,629],{"class":203},"BenchmarkStats",[193,631,632],{"class":207},"\u003C> ",[193,634,635],{"class":199},"const&",[193,637,638],{"class":217}," benchmarkStats",[193,640,587],{"class":207},[193,642,590],{"class":199},[193,644,593],{"class":207},[193,646,648,650,653,655,657,660,662,664],{"class":195,"line":647},4,[193,649,200],{"class":199},[193,651,652],{"class":203}," benchmarkFailed",[193,654,208],{"class":207},[193,656,581],{"class":203},[193,658,659],{"class":217}," error",[193,661,587],{"class":207},[193,663,590],{"class":199},[193,665,593],{"class":207},[13,667,668,669,672],{},"Due to the benchmark lifecycle being bit more complicated, the benchmarking\nevents have their own category, even though they could be seen as parallel\nto the ",[21,670,671],{},"assertion*"," events. You should expect running a benchmark to\ngenerate at least 2 of the events above.",[13,674,675,676,680],{},"To understand the explanation below, you should read the ",[45,677,679],{"href":678},"\u002Fdocs\u002Fbenchmarks\u002F","benchmarking\ndocumentation"," first.",[97,682,683,689,695,701],{},[100,684,685,688],{},[21,686,687],{},"benchmarkPreparing"," event is sent after the environmental probe\nfinishes, but before the user code is first estimated.",[100,690,691,694],{},[21,692,693],{},"benchmarkStarting"," event is sent after the user code is estimated,\nbut has not been benchmarked yet.",[100,696,697,700],{},[21,698,699],{},"benchmarkEnded"," event is sent after the user code has been benchmarked,\nand contains the benchmarking results.",[100,702,703,706],{},[21,704,705],{},"benchmarkFailed"," event is sent if either the estimation or the\nbenchmarking itself fails.",[118,708,77],{"id":709},"miscellaneous-events",[184,711,713],{"className":186,"code":712,"language":188,"meta":189,"style":189},"void reportInvalidTestSpec( StringRef unmatchedSpec );\nvoid fatalErrorEncountered( StringRef error );\nvoid noMatchingTestCases( StringRef unmatchedSpec );\n",[21,714,715,731,746],{"__ignoreMap":189},[193,716,717,719,722,724,726,729],{"class":195,"line":196},[193,718,200],{"class":199},[193,720,721],{"class":203}," reportInvalidTestSpec",[193,723,208],{"class":207},[193,725,581],{"class":203},[193,727,728],{"class":217}," unmatchedSpec",[193,730,221],{"class":207},[193,732,733,735,738,740,742,744],{"class":195,"line":224},[193,734,200],{"class":199},[193,736,737],{"class":203}," fatalErrorEncountered",[193,739,208],{"class":207},[193,741,581],{"class":203},[193,743,659],{"class":217},[193,745,221],{"class":207},[193,747,748,750,753,755,757,759],{"class":195,"line":619},[193,749,200],{"class":199},[193,751,752],{"class":203}," noMatchingTestCases",[193,754,208],{"class":207},[193,756,581],{"class":203},[193,758,728],{"class":217},[193,760,221],{"class":207},[13,762,763],{},"These are one-off events that do not neatly fit into other categories.",[13,765,766,24,769,772,773,777],{},[21,767,768],{},"reportInvalidTestSpec",[21,770,771],{},"noMatchingTestCases"," remain for listeners\nwritten against Catch2. The runner reports invalid and unmatched ",[45,774,776],{"href":775},"\u002Fdocs\u002Fcommand-line\u002F#test-specs","test\nspecs"," itself, before any worker starts, so\nlisteners do not receive these two.",[13,779,780,783],{},[21,781,782],{},"fatalErrorEncountered"," is sent when Catch2's POSIX signal handling\nor Windows SE handler is called into with a fatal signal\u002Fexception.",[785,786,787],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}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 .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}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);}",{"title":189,"searchDepth":224,"depth":224,"links":789},[790,802,803],{"id":120,"depth":224,"text":65,"children":791},[792,794,796,798,800],{"id":178,"depth":619,"text":793},"testRun events",{"id":256,"depth":619,"text":795},"testCase events",{"id":323,"depth":619,"text":797},"testCasePartial events",{"id":414,"depth":619,"text":799},"section events",{"id":479,"depth":619,"text":801},"assertion events",{"id":553,"depth":224,"text":71},{"id":709,"depth":224,"text":77},"md",{},true,"\u002Fdocs\u002Freporter-events",{"title":5,"description":189},"docs\u002Freporter-events.md","docs\u002Freporter-events","vBNV2TlJl_ZQQNoibu-8iqPWzIYyvOAC65uFV2x52xY",1794961595361]