{"id":396766,"date":"2021-03-14T04:20:12","date_gmt":"2021-03-13T20:20:12","guid":{"rendered":"http:\/\/4563.org\/?p=396766"},"modified":"2021-03-14T04:20:12","modified_gmt":"2021-03-13T20:20:12","slug":"%e7%8e%b0%e5%9c%a8%e7%9a%84-c%e7%94%a8%e4%bb%80%e4%b9%88%e5%ba%93%e6%88%96%e8%80%85%e5%b7%a5%e5%85%b7%e5%86%99-unit-test%ef%bc%9f%e6%88%91%e8%ae%b0%e5%be%97-67-%e5%b9%b4%e5%89%8d%e6%98%af%e7%94%a8","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=396766","title":{"rendered":"\u73b0\u5728\u7684 c++\u7528\u4ec0\u4e48\u5e93\u6216\u8005\u5de5\u5177\u5199 unit test\uff1f\u6211\u8bb0\u5f97 6~7 \u5e74\u524d\u662f\u7528\u7684 GTest"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u73b0\u5728\u7684 c++\u7528\u4ec0\u4e48\u5e93\u6216\u8005\u5de5\u5177\u5199 unit test\uff1f\u6211\u8bb0\u5f97 6~7 \u5e74\u524d\u662f\u7528\u7684 GTest               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4ee5\u524d\u5199\u8fc7\u51e0\u5e74\u7684 c++\uff0c\u5f53\u5e74\u7528\u7684 GTest \u5199 unit test\uff0c\u90a3\u4e2a\u75db\u82e6\u554a&#8230;&#8230;\u8fc7\u53bb\u4e86\u8fd9\u4e48\u591a\u5e74\uff08 6~7 \u5e74)\uff0c\u8fd8\u662f\u8fd9\u4e2a\u4e48\uff1f\uff08\u597d\u50cf\u8fd8\u6709\u4e2a cppunit)<\/p>\n<p>javascript\uff0c\u6709 Jest, Enzyme, react\/test-library\uff0c\u7b49\u7b49\u5404\u79cd\u5de5\u5177\uff0c\u5f53\u7136\u4e5f\u5305\u62ec js \u81ea\u5df1\u7684\u7279\u6027\u3002\u5199\u8d77 unit test \u6765\uff0c\u76f8\u5bf9\u8fd8\u662f\u80fd\u591f\u63a5\u53d7\u7684\u3002<\/p>\n<p>\u4e0d\u77e5\u9053 c++\u53d1\u5c55\u7684\u8fd9\u4e48\u4e9b\u5e74\uff0c\u8fd9\u65b9\u9762\u6709\u6ca1\u6709\u53d8\u5316\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5529125\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : edimetia3d <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             gtest \u5e94\u8be5\u8fd8\u662f\u6700\u666e\u904d\u7684<\/p>\n<p>19 \u5e74\u770b\u5230\u4e86 https:\/\/github.com\/onqtam\/doctest \u4e00\u76f4\u6ca1\u627e\u5230\u673a\u4f1a\u7528                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529126\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nightwitch <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             gtest, boost.Test \u4ecd\u7136\u662f\u6700\u666e\u904d\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529127\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Huelse <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u73b0\u5728\u662f\u53eb googletest \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529128\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : livepps <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             google test \u8fd8\u662f\u6700\u666e\u904d\u7684<br \/>catch2 \u4e5f\u53ef\u4ee5\uff0c\u53ea\u9700\u8981\u5305\u542b 1 \u4e2a\u5934\u6587\u4ef6<br \/>doctest \u597d\u50cf\u633a\u706b\u7684\uff0c\u6ca1\u7528\u8fc7\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529129\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : FucUrFrd <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             gmock                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529130\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : littlewing <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             6-7 \u5e74\u540e\u4ecd\u7136\u662f gtest                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529131\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : GeruzoniAnsasu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d mock catch2<\/p>\n<p>mock? \u8001\u8001\u5b9e\u5b9e google test<\/p>\n<p>module \u62d6\u4e86\u8fd9\u4e48\u591a\u5e74\u90fd\u8fd8\u6ca1\u641e\u5b9a\uff0c\u4f60\u80fd\u6307\u671b\u5e93\u548c\u6784\u5efa\u6846\u67b6\u80fd\u6709\u5565\u5927\u53d8\u5316\uff08                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529132\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @GeruzoniAnsasu <br \/>\u4e0d\u662f\u5427\u2026\u2026 <br \/>\u4e0d\u80fd mock\uff0c\u90a3\u4e2d\u540e\u671f\uff0c\u9879\u76ee\u8d8a\u6765\u8d8a\u5927\uff0c\u4f9d\u8d56\u8d8a\u6765\u8d8a\u591a\uff0c\u6d4b\u8bd5\u6ca1\u6cd5\u5199\u4e86\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5529133\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jones2000 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u5f88\u60f3\u77e5\u9053 js \u524d\u7aef\u5bf9\u56fe\u5f62\u662f\u5982\u4f55\u6d4b\u8bd5\u7684. \u6bd4\u5982\u6211\u7528\u4e86 echart \u628a\u56fe\u753b\u51fa\u6765\u4e86, \u6211\u600e\u4e48\u53bb\u6d4b\u8bd5\u8fd9\u4e2a\u56fe\u753b\u7684\u5bf9\u4e0d\u5bf9, \u6d4b\u8bd5\u6587\u6863\u91cc\u9762\u662f\u6709\u7ed9\u51fa\u6b63\u786e\u7684\u56fe,\u4ee5\u53ca\u56fe\u5f62\u4e0a\u7ebf\u6bb5,\u8fb9\u6846,\u67f1\u5b50\u7b49\u539f\u59cb\u7684 rgb \u503c,\u7c97\u7ec6, \u900f\u660e\u5ea6, \u5b57\u4f53\u7b49\u7b49.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u5728\u7684 c++\u7528\u4ec0\u4e48\u5e93\u6216\u8005\u5de5\u5177\u5199 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/396766"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=396766"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/396766\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=396766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=396766"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=396766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}