⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rcunit__suite_8h-source.html

📁 一个做软件测试的源码,可以用于工程中软件测试,全部为自己编写,内付说明
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>RCUnit: include/rcunit/rcunit_suite.h源文件</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- 制作者 Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="index.html">首页</a> | <a class="qindex" href="modules.html">模块</a> | <a class="qindex" href="annotated.html">数据结构</a> | <a class="qindex" href="dirs.html">目录</a> | <a class="qindex" href="files.html">文件列表</a> | <a class="qindex" href="functions.html">数据字段</a> | <a class="qindex" href="globals.html">全局定义</a> | <a class="qindex" href="pages.html">相关页面</a></div><div class="nav"><a class="el" href="dir_000000.html">include</a>&nbsp;/&nbsp;<a class="el" href="dir_000001.html">rcunit</a></div><h1>rcunit_suite.h</h1><a href="rcunit__suite_8h.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment">00001 00006 <span class="preprocessor">#ifndef _RCUNIT_SUITE_H_</span>00007 <span class="preprocessor"></span><span class="preprocessor">#define _RCUNIT_SUITE_H_</span>00008 <span class="preprocessor"></span>00009 <span class="preprocessor">#ifndef _RCUNIT_CASE_H_</span>00010 <span class="preprocessor"></span><span class="preprocessor">#   error "You should include rcunit_case.h first!"</span>00011 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00012 <span class="preprocessor"></span>00013 <span class="preprocessor">#ifdef __cplusplus</span>00014 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {00015 <span class="preprocessor">#endif</span>00016 <span class="preprocessor"></span>00017 <span class="keyword">typedef</span> void (*__CUNIT_TEST_SUITE_EVENT_HANDLER_FUNC_TYPE)();00018 <a name="l00025"></a><a class="code" href="struct____tagCUnitTestSuite.html">00025</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct____tagCUnitTestSuite.html">__tagCUnitTestSuite</a>00026 {<a name="l00027"></a><a class="code" href="struct____tagCUnitTestSuite.html#o0">00027</a>     <a class="code" href="struct____tagCUnitTestCaseListNode.html">__CUNIT_TEST_CASE_LIST_NODE_S</a> *<a class="code" href="struct____tagCUnitTestSuite.html#o0">head</a>;                 <a name="l00028"></a><a class="code" href="struct____tagCUnitTestSuite.html#o1">00028</a>     <a class="code" href="struct____tagCUnitTestCaseListNode.html">__CUNIT_TEST_CASE_LIST_NODE_S</a> *<a class="code" href="struct____tagCUnitTestSuite.html#o1">tail</a>;                 <a name="l00029"></a><a class="code" href="struct____tagCUnitTestSuite.html#o2">00029</a>     __CUNIT_TEST_SUITE_EVENT_HANDLER_FUNC_TYPE <a class="code" href="struct____tagCUnitTestSuite.html#o2">setUp</a>;    <a name="l00030"></a><a class="code" href="struct____tagCUnitTestSuite.html#o3">00030</a>     __CUNIT_TEST_SUITE_EVENT_HANDLER_FUNC_TYPE <a class="code" href="struct____tagCUnitTestSuite.html#o3">tearDown</a>; <a name="l00031"></a><a class="code" href="struct____tagCUnitTestSuite.html#o4">00031</a>     <span class="keywordtype">char</span> *<a class="code" href="struct____tagCUnitTestSuite.html#o4">name</a>;                                          00032 }<a class="code" href="struct____tagCUnitTestSuite.html">__CUNIT_TEST_SUITE_S</a>;00033 <a name="l00039"></a><a class="code" href="struct____tagCUnitTestSuiteListNode.html">00039</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct____tagCUnitTestSuiteListNode.html">__tagCUnitTestSuiteListNode</a>00040 {00041     <span class="keyword">struct </span><a class="code" href="struct____tagCUnitTestSuiteListNode.html">__tagCUnitTestSuiteListNode</a> * next; <span class="comment">/*&lt; 指向下一个测试集链表结点 */</span>00042     <a class="code" href="struct____tagCUnitTestSuite.html">__CUNIT_TEST_SUITE_S</a> *suite;               <span class="comment">/*&lt; 指向测试集 */</span>00043     <span class="keywordtype">char</span> isFailed;                             <span class="comment">/*&lt; 执行测试集之后是否失败 */</span>00044 }<a class="code" href="struct____tagCUnitTestSuiteListNode.html">__CUNIT_TEST_SUITE_LIST_NODE_S</a>;00045 00046 <span class="preprocessor">#define _CUNIT_TEST_SUITE_LIST_NAME __s_stCUnitSuiteListName</span>00047 <span class="preprocessor"></span>00048 <span class="preprocessor">#define _CUNIT_GET_TEST_CASE_LIST_FUNC_NAME(SuiteName) __CUnit_GetTestCaseListOf##SuiteName</span>00049 <span class="preprocessor"></span><span class="preprocessor">#define _CUNIT_DECLARE_TEST_CASE_LIST_FUNC(SuiteName) \</span>00050 <span class="preprocessor">    extern __CUNIT_TEST_SUITE_S * _CUNIT_GET_TEST_CASE_LIST_FUNC_NAME(SuiteName) ()</span>00051 <span class="preprocessor"></span>00052 <span class="preprocessor">#define _CUNIT_DECLARE_TEST_SUITE_EVENT_HANDLER_FUNC(HandlerFunc) \</span>00053 <span class="preprocessor">    CUNIT_DECL_TEST void HandlerFunc()</span>00054 <span class="preprocessor"></span>00122 <span class="comment">/* Test suite macros */</span><a name="l00123"></a><a class="code" href="group__rcunit__write__test__suite.html#ga0">00123</a> <span class="preprocessor">#define CUNIT_TEST_SUITE_BEGIN(SuiteName) \</span>00124 <span class="preprocessor">    __CUNIT_TEST_SUITE_S * _CUNIT_GET_TEST_CASE_LIST_FUNC_NAME(SuiteName) () \</span>00125 <span class="preprocessor">    { \</span>00126 <span class="preprocessor">        static __CUNIT_TEST_SUITE_S stTestSuite = {0};\</span>00127 <span class="preprocessor">        static char * szSuiteName = #SuiteName; \</span>00128 <span class="preprocessor">        static int count = 0; </span><span class="comment">/* ensure this function invoked only once */</span> \00129         if (!count) \00130         { \00131             stTestSuite.setUp = _CUnit_Dummy_Event_Handler; \00132             stTestSuite.tearDown = _CUnit_Dummy_Event_Handler00133 <a name="l00134"></a><a class="code" href="group__rcunit__write__test__suite.html#ga1">00134</a> <span class="preprocessor">#define CUNIT_HANDLE_SET_UP(func) \</span>00135 <span class="preprocessor">            do \</span>00136 <span class="preprocessor">            { \</span>00137 <span class="preprocessor">                _CUNIT_DECLARE_TEST_SUITE_EVENT_HANDLER_FUNC(func); \</span>00138 <span class="preprocessor">                stTestSuite.setUp = func; \</span>00139 <span class="preprocessor">            } \</span>00140 <span class="preprocessor">            while (0)</span>00141 <span class="preprocessor"></span><a name="l00142"></a><a class="code" href="group__rcunit__write__test__suite.html#ga2">00142</a> <span class="preprocessor">#define CUNIT_HANDLE_TEAR_DOWN(func) \</span>00143 <span class="preprocessor">            do \</span>00144 <span class="preprocessor">            { \</span>00145 <span class="preprocessor">                _CUNIT_DECLARE_TEST_SUITE_EVENT_HANDLER_FUNC(func); \</span>00146 <span class="preprocessor">                stTestSuite.tearDown = func; \</span>00147 <span class="preprocessor">            } \</span>00148 <span class="preprocessor">            while (0)</span>00149 <span class="preprocessor"></span><a name="l00150"></a><a class="code" href="group__rcunit__write__test__suite.html#ga3">00150</a> <span class="preprocessor">#define CUNIT_TEST(CaseFunc) \</span>00151 <span class="preprocessor">            do \</span>00152 <span class="preprocessor">            { \</span>00153 <span class="preprocessor">                _CUNIT_DECLARE_TEST_CASE_FUNC(CaseFunc); \</span>00154 <span class="preprocessor">                _CUnit_AddTestCase(&amp;stTestSuite, (CaseFunc), #CaseFunc); \</span>00155 <span class="preprocessor">            } \</span>00156 <span class="preprocessor">            while (0)</span>00157 <span class="preprocessor"></span><a name="l00158"></a><a class="code" href="group__rcunit__write__test__suite.html#ga4">00158</a> <span class="preprocessor">#define CUNIT_TEST_SUITE_END() \</span>00159 <span class="preprocessor">            count++; \</span>00160 <span class="preprocessor">        } \</span>00161 <span class="preprocessor">        stTestSuite.name = szSuiteName; \</span>00162 <span class="preprocessor">        return &amp;stTestSuite; \</span>00163 <span class="preprocessor">    } \</span>00164 <span class="preprocessor">    typedef int __CUnitDummyTypedefForSemiColonEnding__ </span><span class="comment">/* use this to accept ";" */</span>00165 <a name="l00189"></a><a class="code" href="group__rcunit__registing__test__suite.html#ga0">00189</a> <span class="preprocessor">#define CUNIT_ADD_TEST_SUITE(SuiteName) \</span>00190 <span class="preprocessor">    do \</span>00191 <span class="preprocessor">    { \</span>00192 <span class="preprocessor">        _CUNIT_DECLARE_TEST_CASE_LIST_FUNC(SuiteName); \</span>00193 <span class="preprocessor">        _CUnit_AddTestSuite(_CUNIT_GET_TEST_CASE_LIST_FUNC_NAME(SuiteName)()); \</span>00194 <span class="preprocessor">    } \</span>00195 <span class="preprocessor">    while (0)</span>00196 <span class="preprocessor"></span>00199 <span class="preprocessor">#ifdef __cplusplus</span>00200 <span class="preprocessor"></span>}00201 <span class="preprocessor">#endif</span>00202 <span class="preprocessor"></span>00203 <span class="preprocessor">#endif </span><span class="comment">/* ifndef _RCUNIT_SUITE_H_ */</span></pre></div><hr/><table width="100%">  <tr>    <td align="right" valign="center">    如果对 RCUnit 有任何的疑问或建议,请联系realdodo (<a href="mailto:realdodo@163.com">realdodo@163.com</a>)。    </td>  </tr></table></body> </html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -