资源简介
压缩包中包括了CUnit源程序和《Cunit实践入门.pdf》。《Cunit实践入门.pdf》详细描述了CUnit单元测试的方法&步骤。更多相关文献见网站www.openlek.com。
代码片段和文件信息
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 200420052006 Anil Kumar Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not write to the Free Software
* Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*/
/*
* Implementation of the Automated Test Interface.
*
* Feb 2002 Initial implementation. (AK)
*
* 13/Feb/2002 Added initial automated interface functions to generate
* HTML based Run report. (AK)
*
* 23/Jul/2002 Changed HTML to xml Format file generation for Automated Tests. (AK)
*
* 27/Jul/2003 Fixed a bug which hinders the listing of all failures. (AK)
*
* 17-Jul-2004 New interface doxygen comments eliminate compiler warnings
* automated_run_tests now assigns a generic file name if
* none has been supplied. (JDS)
*
* 30-Apr-2005 Added notification of failed suite cleanup function. (JDS)
*/
/** @file
* Automated test interface with xml result output (implementation).
*/
/** @addtogroup Automated
@{
*/
#include
#include
#include
#include
#include
#include
#include
#include “CUnit.h“
#include “TestDB.h“
#include “Util.h“
#include “TestRun.h“
#include “Automated.h“
static CU_pSuite f_pRunningSuite = NULL; /**< The running test suite. */
static char f_szDefaultFileRoot[] = “CUnitAutomated“; /**< Default filename root for automated output files. */
static char f_szTestListFileName[FILENAME_MAX] = ““; /**< Current output file name for the test listing file. */
static char f_szTestResultFileName[FILENAME_MAX] = ““; /**< Current output file name for the test results file. */
static FILE* f_pTestResultFile = NULL; /**< FILE pointer the test results file. */
static CU_BOOL f_bWriting_CUNIT_RUN_SUITE = CU_FALSE; /**< Flag for keeping track of when a closing xml tag is required. */
static CU_ErrorCode automated_list_all_tests(CU_pTestRegistry pRegistry const char* szFilename);
static CU_ErrorCode initialize_result_file(const char* szFilename);
static CU_ErrorCode uninitialize_result_file(void);
static void automated_run_all_tests(CU_pTestRegistry pRegistry);
st
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 352 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\AUTHORS
文件 724 2005-08-04 20:25 Cunit实践入门\CUnit-2.1-0\bootstrap
文件 12471 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\ChangeLog
文件 2057 2005-08-04 18:49 Cunit实践入门\CUnit-2.1-0\config.h.in
文件 8149 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\configure.in
文件 26458 2005-07-24 18:13 Cunit实践入门\CUnit-2.1-0\COPYING
文件 140288 2009-08-08 23:28 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.bsc
文件 4086 2009-08-09 00:00 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.dsp
文件 535 2009-08-05 22:56 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.dsw
文件 204386 2009-08-08 23:28 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.lib
文件 91136 2009-08-09 00:00 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.ncb
文件 53760 2009-08-09 00:00 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.opt
文件 1804 2009-08-08 23:28 Cunit实践入门\CUnit-2.1-0\CUnit\CUnit.plg
文件 2111 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\Automated.h
文件 2081 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\Basic.h
文件 1773 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\Console.h
文件 1806 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\CUCurses.h
文件 5236 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\CUError.h
文件 19137 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\CUnit.h
文件 19151 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\CUnit.h.in
文件 1244 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\Jamfile
文件 839 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\Makefile.am
文件 4201 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\MyMem.h
文件 16182 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\TestDB.h
文件 8867 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\TestRun.h
文件 3034 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Headers\Util.h
..AD... 0 2009-08-05 22:55 Cunit实践入门\CUnit-2.1-0\CUnit\Headers
文件 4502 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\CUnit\Jamfile
文件 88 2006-03-20 20:30 Cunit实践入门\CUnit-2.1-0\CUnit\Makefile.am
文件 22399 2006-01-29 22:48 Cunit实践入门\CUnit-2.1-0\CUnit\Sources\Automated\Automated.c
............此处省略218个文件信息
评论
共有 条评论