[{"data":1,"prerenderedAt":316},["ShallowReactive",2],{"doc-ci-and-misc":3},{"id":4,"title":5,"body":6,"description":295,"extension":307,"meta":308,"navigation":309,"path":310,"seo":311,"slug":312,"source":313,"stem":314,"__hash__":315},"docs\u002Fdocs\u002Fci-and-misc.md","Tooling integration (CI, test runners and so on)",{"type":7,"value":8,"toc":294},"minimark",[9,50,54,86,89,93,125,128,131,172,187,194,203,215,226,229,232,237,244,247,260,264,285,288],[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},"tooling-integration-ci-test-runners-and-so-on",[13,55,56,59,62,66,68,72,74,78,80,84],{},[16,57,58],{},"Contents",[60,61],"br",{},[45,63,65],{"href":64},"#continuous-integration-systems","Continuous Integration systems",[60,67],{},[45,69,71],{"href":70},"#bazel-test-runner-integration","Bazel test runner integration",[60,73],{},[45,75,77],{"href":76},"#low-level-tools","Low-level tools",[60,79],{},[45,81,83],{"href":82},"#cmake","CMake",[60,85],{},[13,87,88],{},"This page talks about Catch2's integration with other related tooling,\nlike Continuous Integration and 3rd party test runners.",[90,91,65],"h2",{"id":92},"continuous-integration-systems",[13,94,95,96,100,101,104,105,24,108,111,112,115,116,119,120,124],{},"The ",[45,97,99],{"href":98},"\u002Fdocs\u002Fprogmasoft-runner\u002F","Catch3 runner"," writes the reports build\nservers read: ",[21,102,103],{},"--junit=FILE"," for JUnit XML, which most CI systems display,\nwith flaky tests and retries in the ",[21,106,107],{},"\u003CflakyFailure>",[21,109,110],{},"\u003CrerunFailure>","\nelements Jenkins and GitLab understand, and ",[21,113,114],{},"--json=FILE"," for everything\nelse. Under ",[21,117,118],{},"bazel test"," the JUnit report goes to the file Bazel names. See\n",[45,121,123],{"href":122},"\u002Fdocs\u002Freporters\u002F","reports",".",[90,126,71],{"id":127},"bazel-test-runner-integration",[13,129,130],{},"Catch2 understands some of the environment variables Bazel uses to control\ntest execution. Specifically it understands",[132,133,134,141,147,160,166],"ul",{},[135,136,137,138],"li",{},"JUnit output path via ",[21,139,140],{},"XML_OUTPUT_FILE",[135,142,143,144],{},"Test filtering via ",[21,145,146],{},"TESTBRIDGE_TEST_ONLY",[135,148,149,150,36,153,156,157],{},"Test sharding via ",[21,151,152],{},"TEST_SHARD_INDEX",[21,154,155],{},"TEST_TOTAL_SHARDS",", and ",[21,158,159],{},"TEST_SHARD_STATUS_FILE",[135,161,162,163],{},"Creating a file to signal premature test exit via ",[21,164,165],{},"TEST_PREMATURE_EXIT_FILE",[135,167,168,169],{},"Setting the RNG seed via ",[21,170,171],{},"TEST_RANDOM_SEED",[10,173,174],{},[13,175,176,177,179,180,186],{},"Support for ",[21,178,140],{}," was ",[45,181,185],{"href":182,"rel":183},"https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Fpull\u002F2399",[184],"nofollow","introduced"," in Catch2 3.0.1",[10,188,189],{},[13,190,176,191,193],{},[21,192,146],{}," and sharding was introduced in Catch2 3.2.0",[10,195,196],{},[13,197,176,198,24,200,202],{},[21,199,165],{},[21,201,171],{}," was introduced in Catch2 3.11.0",[13,204,205,206,210,211,214],{},"This integration is enabled via either a ",[45,207,209],{"href":208},"\u002Fdocs\u002Fconfiguration\u002F#bazel-support","compile time configuration\noption",", or via ",[21,212,213],{},"BAZEL_TEST"," environment\nvariable set to \"1\".",[10,216,217],{},[13,218,176,219,179,221,225],{},[21,220,213],{},[45,222,185],{"href":223,"rel":224},"https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Fpull\u002F2459",[184]," in Catch2 3.1.0",[13,227,228],{},"Note that if both the Bazel environment var and command line option for\nsomething are used, the environment variable wins.",[90,230,77],{"id":231},"low-level-tools",[233,234,236],"h3",{"id":235},"codecoverage-module-gcov-lcov","CodeCoverage module (GCOV, LCOV...)",[13,238,239,240],{},"If you are using GCOV tool to get testing coverage of your code, and are not sure how to integrate it with CMake and Catch, there should be an external example over at ",[45,241,242],{"href":242,"rel":243},"https:\u002F\u002Fgithub.com\u002Fclaremacrae\u002Fcatch_cmake_coverage",[184],[233,245,246],{"id":246},"pkg-config",[13,248,249,250,253,254,256,257,124],{},"Catch2 provides a rudimentary pkg-config integration, by registering itself\nunder the name ",[21,251,252],{},"catch2",". This means that after Catch2 is installed, you\ncan use ",[21,255,246],{}," to get its include path: ",[21,258,259],{},"pkg-config --cflags catch2",[233,261,263],{"id":262},"gdb-and-lldb-scripts","gdb and lldb scripts",[13,265,266,267,270,271,274,275,24,278,274,281,284],{},"Catch2's ",[21,268,269],{},"extras"," folder also contains two simple debugger scripts,\n",[21,272,273],{},"gdbinit"," for ",[21,276,277],{},"gdb",[21,279,280],{},"lldbinit",[21,282,283],{},"lldb",". If loaded into their\nrespective debugger, these will tell it to step over Catch2's internals\nwhen stepping through code.",[90,286,83],{"id":287},"cmake",[13,289,290],{},[45,291,293],{"href":292},"\u002Fdocs\u002Fcmake-integration\u002F","As it has been getting kinda long, the documentation of Catch2's\nintegration with CMake has been moved to its own page.",{"title":295,"searchDepth":296,"depth":296,"links":297},"",2,[298,299,300,306],{"id":92,"depth":296,"text":65},{"id":127,"depth":296,"text":71},{"id":231,"depth":296,"text":77,"children":301},[302,304,305],{"id":235,"depth":303,"text":236},3,{"id":246,"depth":303,"text":246},{"id":262,"depth":303,"text":263},{"id":287,"depth":296,"text":83},"md",{},true,"\u002Fdocs\u002Fci-and-misc",{"title":5,"description":295},"ci-and-misc","docs\u002Fci-and-misc.md","docs\u002Fci-and-misc","NvzRE8s7obOrHmrkQiDUvUJkCALagPpRA6PaKlEurhc",1794961594109]