[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EA7ED0DAY3WP1SECRF0MTV":3,"skill-same:01M6EA7ED0DAY3WP1SECRF0MTV":93},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":51,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6EA7ED0DAY3WP1SECRF0MTV","doctest-cmake",null,"Set up doctest testing framework in CMake C++ projects and write tests colocated with implementation code","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FEvitanRelta\u002Fdoctest-cmake\u002FSKILL.md\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40],"cmake","doctest cmake","testing","write tests","code","framework","testing framework","SET","projects","write","up","implementation","c++","tests","2026-11-10 10:12:30",false,"---\nname: doctest-cmake\ndescription: Set up doctest testing framework in CMake C++ projects and write tests colocated with implementation code\n---\n\n## What I Do\n\nGuide setup and usage of the doctest single-header C++17 testing framework in CMake projects, with tests written directly in source files alongside the code they test.\n\n## Setup Instructions\n\n### 1. Verify doctest header exists\n\nEnsure the doctest header is present (e.g. in the below example, it's at `third-party\u002Fdoctest\u002Fdoctest.h`). This file must already exist in the repository.\n\n### 2. Create test runner entry point\n\nCreate `test_main.cpp` at project root:\n\n```cpp\n#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n#include \"doctest\u002Fdoctest.h\"\n```\n\nThis file provides doctest's `main()` function for the test executable.\n\n### 3. Update CMakeLists.txt\n\nAdd a test executable target alongside your main target:\n\n```cmake\n# Main application (unchanged)\nadd_executable(your_app\n    main.cpp\n    your_source.cpp\n)\n\n# Disable doctest in main application\ntarget_compile_definitions(your_app PRIVATE DOCTEST_CONFIG_DISABLE)\n\n# Test executable\nadd_executable(tests\n    test_main.cpp\n    your_source.cpp  # Same sources as main app\n)\n\ntarget_include_directories(tests PRIVATE\n    ${CMAKE_CURRENT_SOURCE_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}\u002Fthird-party\n)\n```\n\nKey points:\n- Include the same source files in both targets\n- Include the directory of where `doctest.h` is, so `#include \"doctest\u002Fdoctest.h\"` resolves\n- Use `DOCTEST_CONFIG_DISABLE` on the main app to strip out all test code\n- No preprocessor guards needed in source files - doctest handles this automatically\n\n## Writing Tests\n\n### Location\n\nWrite tests in the `.cpp` file where the code is **defined** (the implementation file), not in headers where code is declared.\n\n### Pattern\n\nAdd tests at the bottom of source files:\n\n```cpp\n\u002F\u002F your_source.cpp\n\n#include \"your_source.h\"\n\n\u002F\u002F Implementation code here\nint add(int a, int b) {\n    return a + b;\n}\n\n\u002F\u002F Tests - automatically disabled in main app via DOCTEST_CONFIG_DISABLE\n#include \"doctest\u002Fdoctest.h\"\n\nTEST_CASE(\"add function\") {\n    CHECK(add(2, 3) == 5);\n    CHECK(add(-1, 1) == 0);\n    CHECK(add(0, 0) == 0);\n}\n```\n\n### Why this pattern\n\n- Tests live next to the code they test for easy maintenance\n- `DOCTEST_CONFIG_DISABLE` in the main app target strips out all test code automatically\n- No preprocessor guards needed in source files\n- No separate test directory structure needed\n\n## Building and Running\n\n```bash\ncmake -B build\ncmake --build build\n\n.\u002Fbuild\u002Fyour_app   # Run application\n.\u002Fbuild\u002Ftests      # Run tests\n```\n\n## When to Use This Skill\n\n- Setting up doctest in a new or existing CMake C++ project\n- Adding tests to C++ source files\n- Understanding the colocated test pattern with conditional compilation\n\n","## What I Do\n\nGuide setup and usage of the doctest single-header C++17 testing framework in CMake projects, with tests written directly in source files alongside the code they test.\n\n## Setup Instructions\n\n### 1. Verify doctest header exists\n\nEnsure the doctest header is present (e.g. in the below example, it's at `third-party\u002Fdoctest\u002Fdoctest.h`). This file must already exist in the repository.\n\n### 2. Create test runner entry point\n\nCreate `test_main.cpp` at project root:\n\n```cpp\n#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n#include \"doctest\u002Fdoctest.h\"\n```\n\nThis file provides doctest's `main()` function for the test executable.\n\n### 3. Update CMakeLists.txt\n\nAdd a test executable target alongside your main target:\n\n```cmake\n# Main application (unchanged)\nadd_executable(your_app\n    main.cpp\n    your_source.cpp\n)\n\n# Disable doctest in main application\ntarget_compile_definitions(your_app PRIVATE DOCTEST_CONFIG_DISABLE)\n\n# Test executable\nadd_executable(tests\n    test_main.cpp\n    your_source.cpp  # Same sources as main app\n)\n\ntarget_include_directories(tests PRIVATE\n    ${CMAKE_CURRENT_SOURCE_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}\u002Fthird-party\n)\n```\n\nKey points:\n- Include the same source files in both targets\n- Include the directory of where `doctest.h` is, so `#include \"doctest\u002Fdoctest.h\"` resolves\n- Use `DOCTEST_CONFIG_DISABLE` on the main app to strip out all test code\n- No preprocessor guards needed in source files - doctest handles this automatically\n\n## Writing Tests\n\n### Location\n\nWrite tests in the `.cpp` file where the code is **defined** (the implementation file), not in headers where code is declared.\n\n### Pattern\n\nAdd tests at the bottom of source files:\n\n```cpp\n\u002F\u002F your_source.cpp\n\n#include \"your_source.h\"\n\n\u002F\u002F Implementation code here\nint add(int a, int b) {\n    return a + b;\n}\n\n\u002F\u002F Tests - automatically disabled in main app via DOCTEST_CONFIG_DISABLE\n#include \"doctest\u002Fdoctest.h\"\n\nTEST_CASE(\"add function\") {\n    CHECK(add(2, 3) == 5);\n    CHECK(add(-1, 1) == 0);\n    CHECK(add(0, 0) == 0);\n}\n```\n\n### Why this pattern\n\n- Tests live next to the code they test for easy maintenance\n- `DOCTEST_CONFIG_DISABLE` in the main app target strips out all test code automatically\n- No preprocessor guards needed in source files\n- No separate test directory structure needed\n\n## Building and Running\n\n```bash\ncmake -B build\ncmake --build build\n\n.\u002Fbuild\u002Fyour_app   # Run application\n.\u002Fbuild\u002Ftests      # Run tests\n```\n\n## When to Use This Skill\n\n- Setting up doctest in a new or existing CMake C++ project\n- Adding tests to C++ source files\n- Understanding the colocated test pattern with conditional compilation\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FEvitanRelta\u002Fdoctest-cmake\u002FSKILL.md",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill doctest-cmake",{"tool":61,"command":62},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill doctest-cmake",{"tool":64,"command":65},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill doctest-cmake","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FEvitanRelta\u002Fdoctest-cmake\u002FSKILL.md\u002FSKILL.md",true,[69,75,79,85,89],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"assets\u002Fmodule-help.csv","ASSET","资产文件",2890,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fbmad-bmb-setup\u002Fassets\u002Fmodule-help.csv",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"assets\u002Fmodule.yaml",886,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fbmad-bmb-setup\u002Fassets\u002Fmodule.yaml",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"scripts\u002Fcleanup-legacy.py","SCRIPT","脚本",7743,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fbmad-bmb-setup\u002Fscripts\u002Fcleanup-legacy.py",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fmerge-config.py",14139,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fbmad-bmb-setup\u002Fscripts\u002Fmerge-config.py",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"scripts\u002Fmerge-help-csv.py",6607,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fbmad-bmb-setup\u002Fscripts\u002Fmerge-help-csv.py",[94,104,114,123,129,136],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":100,"publishedAt":41},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[99],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[101,102,103],"model","model hierarchy","model hierarchy skill",{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":110,"publishedAt":41},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[109],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[111,112,113],"MCP","zoom","zoom mcp",{"skillNo":115,"name":116,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":41},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[120,121,122,112],"sdk","zoom apps sdk","apps",{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":41},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[125],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":135,"publishedAt":41},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[134],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[131],{"skillNo":137,"name":138,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":41},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[138]]