[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-516":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},516,"Catch2","catchorg\u002FCatch2","catchorg","A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)",null,"https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2","C++",20437,3238,426,389,0,12,24,73,36,45,false,"main",[25,26,27,28,29,30,31,32],"testing","test-framework","tdd","bdd","no-dependencies","framework","cpp14","cpp","2026-06-12 02:00:14","\u003Ca id=\"top\">\u003C\u002Fa>\n![Catch2 logo](data\u002Fartwork\u002Fcatch2-logo-full-with-background.svg)\n\n[![Github Releases](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Fcatchorg\u002Fcatch2.svg)](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002Fcatch2\u002Freleases)\n[![Linux build status](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Factions\u002Fworkflows\u002Flinux-simple-builds.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Factions\u002Fworkflows\u002Flinux-simple-builds.yml)\n[![Linux build status](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Factions\u002Fworkflows\u002Flinux-other-builds.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Factions\u002Fworkflows\u002Flinux-other-builds.yml)\n[![MacOS build status](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Factions\u002Fworkflows\u002Fmac-builds.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Factions\u002Fworkflows\u002Fmac-builds.yml)\n[![Build Status](https:\u002F\u002Fci.appveyor.com\u002Fapi\u002Fprojects\u002Fstatus\u002Fgithub\u002Fcatchorg\u002FCatch2?svg=true&branch=devel)](https:\u002F\u002Fci.appveyor.com\u002Fproject\u002Fcatchorg\u002Fcatch2)\n[![Code Coverage](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fcatchorg\u002FCatch2\u002Fbranch\u002Fdevel\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fcatchorg\u002FCatch2)\n[![Try online](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftry-online-blue.svg)](https:\u002F\u002Fgodbolt.org\u002Fz\u002FEdoY15q9G)\n[![Join the chat in Discord: https:\u002F\u002Fdiscord.gg\u002F4CWS9zD](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-Chat!-brightgreen.svg)](https:\u002F\u002Fdiscord.gg\u002F4CWS9zD)\n\n\n## What is Catch2?\n\nCatch2 is mainly a unit testing framework for C++, but it also\nprovides basic micro-benchmarking features, and simple BDD macros.\n\nCatch2's main advantage is that using it is both simple and natural.\nTest names do not have to be valid identifiers, assertions look like\nnormal C++ boolean expressions, and sections provide a nice and local way\nto share set-up and tear-down code in tests.\n\n**Example unit test**\n```cpp\n#include \u003Ccatch2\u002Fcatch_test_macros.hpp>\n\n#include \u003Ccstdint>\n\nuint32_t factorial( uint32_t number ) {\n    return number \u003C= 1 ? number : factorial(number-1) * number;\n}\n\nTEST_CASE( \"Factorials are computed\", \"[factorial]\" ) {\n    REQUIRE( factorial( 1) == 1 );\n    REQUIRE( factorial( 2) == 2 );\n    REQUIRE( factorial( 3) == 6 );\n    REQUIRE( factorial(10) == 3'628'800 );\n}\n```\n\n**Example microbenchmark**\n```cpp\n#include \u003Ccatch2\u002Fcatch_test_macros.hpp>\n#include \u003Ccatch2\u002Fbenchmark\u002Fcatch_benchmark.hpp>\n\n#include \u003Ccstdint>\n\nuint64_t fibonacci(uint64_t number) {\n    return number \u003C 2 ? number : fibonacci(number - 1) + fibonacci(number - 2);\n}\n\nTEST_CASE(\"Benchmark Fibonacci\", \"[!benchmark]\") {\n    REQUIRE(fibonacci(5) == 5);\n\n    REQUIRE(fibonacci(20) == 6'765);\n    BENCHMARK(\"fibonacci 20\") {\n        return fibonacci(20);\n    };\n\n    REQUIRE(fibonacci(25) == 75'025);\n    BENCHMARK(\"fibonacci 25\") {\n        return fibonacci(25);\n    };\n}\n```\n\n_Note that benchmarks are not run by default, so you need to run it explicitly\nwith the `[!benchmark]` tag._\n\n\n## Catch2 v3 has been released!\n\nYou are on the `devel` branch, where the v3 version is being developed.\nv3 brings a bunch of significant changes, the big one being that Catch2\nis no longer a single-header library. Catch2 now behaves as a normal\nlibrary, with multiple headers and separately compiled implementation.\n\nThe documentation is slowly being updated to take these changes into\naccount, but this work is currently still ongoing.\n\nFor migrating from the v2 releases to v3, you should look at [our\ndocumentation](docs\u002Fmigrate-v2-to-v3.md#top). It provides a simple\nguidelines on getting started, and collects most common migration\nproblems.\n\nFor the previous major version of Catch2 [look into the `v2.x` branch\nhere on GitHub](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Ftree\u002Fv2.x).\n\n\n## How to use it\nThis documentation comprises these three parts:\n\n* [Why do we need yet another C++ Test Framework?](docs\u002Fwhy-catch.md#top)\n* [Tutorial](docs\u002Ftutorial.md#top) - getting started\n* [Reference section](docs\u002FReadme.md#top) - all the details\n\n\n## More\n* Issues and bugs can be raised on the [Issue tracker on GitHub](https:\u002F\u002Fgithub.com\u002Fcatchorg\u002FCatch2\u002Fissues)\n* For discussion or questions please use [our Discord](https:\u002F\u002Fdiscord.gg\u002F4CWS9zD)\n* See who else is using Catch2 in [Open Source Software](docs\u002Fopensource-users.md#top)\nor [commercially](docs\u002Fcommercial-users.md#top).\n","Catch2 是一个现代的 C++ 原生测试框架，主要用于单元测试、TDD 和 BDD。它支持 C++14、C++17 及更高版本，并且在 v2.x 分支中提供了 C++11 支持，在 Catch1.x 分支中提供了 C++03 支持。核心功能包括简洁自然的测试命名、类似普通 C++ 布尔表达式的断言以及方便的设置和清理代码共享机制。此外，Catch2 还提供了基本的微基准测试功能。适用于需要高效、简洁地进行 C++ 代码测试的各种开发场景，尤其是对代码质量和性能有高要求的项目。",2,"2026-06-11 02:37:01","trending"]