亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? console.c

?? CUNIT c 測試框架,類似大名鼎鼎的junit,很有用的,這里是原代碼,可以編譯生成lib文件
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 *  CUnit - A Unit testing framework library for C.
 *  Copyright (C) 2001            Anil Kumar
 *  Copyright (C) 2004,2005,2006  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 Console Test Interface.
 *
 *  Aug 2001      Initial implementation (AK)
 *
 *  19/Aug/2001   Added initial console interface functions without
 *                any run functionality. (AK)
 *
 *  24/Aug/2001   Added compare_strings, show_errors, list_suites,
 *                list_tests function declarations. (AK)
 *
 *  17-Jul-2004   New interface, doxygen comments, reformat console output. (JDS)
 *
 *  30-Apr-2005   Added notification of suite cleanup failure. (JDS)
 */

/** @file
 * Console test interface with interactive output (implementation).
 */
/** @addtogroup Console
 @{
*/

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include <string.h>

#include "CUnit.h"
#include "TestDB.h"
#include "Util.h"
#include "TestRun.h"
#include "Console.h"

/** Console interface status flag. */
typedef enum
{
  CONTINUE = 1,   /**< Continue processing commands in current menu. */
  MOVE_UP,        /**< Move up to the previous menu. */
  STOP            /**< Stop processing (user selected 'Quit'). */
} STATUS;

/** Pointer to the currently running suite. */
static CU_pSuite f_pRunningSuite = NULL;

/* Forward declaration of module functions */
static void console_registry_level_run(CU_pTestRegistry pRegistry);
static STATUS console_suite_level_run(CU_pSuite pSuite);

static CU_ErrorCode console_run_all_tests(CU_pTestRegistry pRegistry);
static CU_ErrorCode console_run_suite(CU_pSuite pSuite);
static CU_ErrorCode console_run_single_test(CU_pSuite pSuite, CU_pTest pTest);

static void console_test_start_message_handler(const CU_pTest pTest, const CU_pSuite pSuite);
static void console_test_complete_message_handler(const CU_pTest pTest, const CU_pSuite pSuite, const CU_pFailureRecord pFailure);
static void console_all_tests_complete_message_handler(const CU_pFailureRecord pFailure);
static void console_suite_init_failure_message_handler(const CU_pSuite pSuite);
static void console_suite_cleanup_failure_message_handler(const CU_pSuite pSuite);

static CU_ErrorCode select_test(CU_pSuite pSuite, CU_pTest* ppTest);
static CU_ErrorCode select_suite(CU_pTestRegistry pRegistry, CU_pSuite* ppSuite);

static void list_suites(CU_pTestRegistry pRegistry);
static void list_tests(CU_pSuite pSuite);
static void show_failures(void);

/*------------------------------------------------------------------------*/
/** Run registered CUnit tests using the console interface. */
void CU_console_run_tests(void)
{
  /*
   *   To avoid user from cribbing about the output not coming onto
   *   screen at the moment of SIGSEGV.
   */
  setvbuf(stdout, NULL, _IONBF, 0);
  setvbuf(stderr, NULL, _IONBF, 0);

  fprintf(stdout, "\n\n     CUnit - A Unit testing framework for C - Version " CU_VERSION
                  "\n     http://cunit.sourceforge.net/\n\n");

  if (NULL == CU_get_registry()) {
    fprintf(stderr, "\n\nFATAL ERROR - Test registry is not initialized.\n");
    CU_set_error(CUE_NOREGISTRY);
  }
  else {
    CU_set_test_start_handler(console_test_start_message_handler);
    CU_set_test_complete_handler(console_test_complete_message_handler);
    CU_set_all_test_complete_handler(console_all_tests_complete_message_handler);
    CU_set_suite_init_failure_handler(console_suite_init_failure_message_handler);
    CU_set_suite_cleanup_failure_handler(console_suite_cleanup_failure_message_handler);

    console_registry_level_run(NULL);
  }
}

/*------------------------------------------------------------------------*/
/** Main loop for console interface.
 *  Displays actions and responds based on user imput.
 *  If pRegistry is NULL, will use the default internal CUnit
 *  test registry.
 *  @param pRegistry The CU_pTestRegistry to use for testing.
 */
static void console_registry_level_run(CU_pTestRegistry pRegistry)
{
  int chChoice;
  char szTemp[256];
  CU_pSuite pSuite = NULL;
  STATUS eStatus = CONTINUE;

  while (CONTINUE == eStatus)
  {
    fprintf(stdout, "\n*************** CUNIT CONSOLE - MAIN MENU ***********************"
                    "\n(R)un all, (S)elect suite, (L)ist suites, Show (F)ailures, (Q)uit"
                    "\nEnter Command : ");
    chChoice = getchar();
    fgets(szTemp, sizeof(szTemp), stdin);

    switch (tolower(chChoice)) {
      case 'r':
        console_run_all_tests(pRegistry);
        break;

      case 's':
        if (CUE_SUCCESS == select_suite(pRegistry, &pSuite)) {
          if (STOP == console_suite_level_run(pSuite)) {
            eStatus = STOP;
          }
        }
        else {
          fprintf(stdout, "\nSuite not found.\n");
        }
        break;

      case 'l':
        list_suites(pRegistry);
        break;

      case 'f':
        show_failures();
        break;

      case 'q':
        eStatus = STOP;
        break;

      /* To stop gcc from cribbing */
      default:
        break;
    }
  }
}

/*------------------------------------------------------------------------*/
/** Run a selected suite within the console interface.
 *  Displays actions and responds based on user imput.
 *  @param pSuite The suite to use for testing (non-NULL).
 */
static STATUS console_suite_level_run(CU_pSuite pSuite)
{
  int chChoice;
  char szTemp[256];
  CU_pTest pTest = NULL;
  STATUS eStatus = CONTINUE;

  assert(NULL != pSuite);

  while (CONTINUE == eStatus) {

    fprintf(stdout, "\n*************** CUNIT CONSOLE - SUITE MENU *******************************"
                    "\n(R)un All, (S)elect test, (L)ist tests, Show (F)ailures, (M)ove up, (Q)uit"
                    "\nEnter Command : ");
    chChoice = getchar();
    fgets(szTemp, sizeof(szTemp), stdin);

    switch (tolower(chChoice)) {
      case 'r':
        console_run_suite(pSuite);
        break;

      case 's':
        if (CUE_SUCCESS == select_test(pSuite, &pTest)) {
          console_run_single_test(pSuite, pTest);
        }
        break;

      case 'l':
        list_tests(pSuite);
        break;

      case 'f':
        show_failures();
        break;

      case 'm':
        eStatus = MOVE_UP;
        break;

      case 'q':
        eStatus = STOP;
        break;

      /* To stop gcc from cribbing */
      default:
        break;
    }
  }
  return eStatus;
}

/*------------------------------------------------------------------------*/
/** Run all tests within the console interface.
 *  The test registry is changed to the specified registry
 *  before running the tests, and reset to the original
 *  registry when done.  If pRegistry is NULL, the default
 *  internal CUnit test registry is used.
 *  @param pRegistry The CU_pTestRegistry containing the tests
 *                   to be run.
 *  @return An error code indicating the error status
 *          during the test run.
 */
static CU_ErrorCode console_run_all_tests(CU_pTestRegistry pRegistry)
{
  CU_pTestRegistry pOldRegistry = NULL;
  CU_ErrorCode result;

  f_pRunningSuite = NULL;

  if (NULL != pRegistry) {
    pOldRegistry = CU_set_registry(pRegistry);
  }
  result = CU_run_all_tests();
  if (NULL != pRegistry) {
    CU_set_registry(pOldRegistry);
  }
  return result;
}

/*------------------------------------------------------------------------*/
/** Run a specified suite within the console interface.
 *  @param pSuite The suite to be run (non-NULL).
 *  @return An error code indicating the error status
 *          during the test run.
 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久妇女6080 | 精品一区二区三区视频| 国产精品99久久久久久似苏梦涵| 日本韩国欧美一区二区三区| 欧美亚洲国产一区在线观看网站 | 国产乱码精品一品二品| 94-欧美-setu| 日韩精品中午字幕| 久久先锋影音av鲁色资源| 亚洲一区二区三区四区五区黄| 亚洲成av人片在www色猫咪| 国产成人av影院| 欧美美女激情18p| 中文字幕在线一区二区三区| 麻豆一区二区99久久久久| 成人黄色小视频| xf在线a精品一区二区视频网站| 一区二区三区四区蜜桃| 国产999精品久久久久久绿帽| 欧美精品一二三区| 成人免费在线播放视频| 精品在线观看免费| www.欧美日韩| 精品福利一区二区三区| 亚洲电影在线播放| aaa国产一区| 中文字幕av一区 二区| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产乱码精品一区二区三| 91精品久久久久久久91蜜桃| 亚洲视频小说图片| 高清成人在线观看| 精品国产亚洲一区二区三区在线观看| 亚洲欧美一区二区不卡| 国产suv一区二区三区88区| 日韩欧美国产综合一区| 亚洲影院久久精品| 成人黄色国产精品网站大全在线免费观看 | 欧美日韩国产天堂| 亚洲麻豆国产自偷在线| 麻豆久久久久久| 欧美电影在线免费观看| 一区二区三区欧美亚洲| 欧美午夜精品免费| 亚洲激情一二三区| 99久久精品国产一区二区三区| 欧美国产激情一区二区三区蜜月| 久久91精品国产91久久小草| 91精品国产一区二区人妖| 亚洲午夜羞羞片| 在线免费不卡视频| 一区二区三区久久久| 91丝袜美女网| 一片黄亚洲嫩模| 色综合色综合色综合色综合色综合| 久久尤物电影视频在线观看| 日韩不卡在线观看日韩不卡视频| 欧美唯美清纯偷拍| 亚洲一区二区精品久久av| 在线视频观看一区| 国产精品成人午夜| 97超碰欧美中文字幕| 最新高清无码专区| 欧美主播一区二区三区美女| 一区二区三区在线观看网站| 在线看不卡av| 亚洲一卡二卡三卡四卡无卡久久| 欧美主播一区二区三区美女| 亚洲妇熟xx妇色黄| 69精品人人人人| 亚洲一区在线看| 欧美放荡的少妇| 麻豆视频一区二区| 国产精品视频免费| 91美女在线观看| 亚洲第一综合色| 在线观看一区日韩| 日韩精品乱码av一区二区| 日韩欧美国产系列| 久久精品国内一区二区三区| 中文字幕欧美日本乱码一线二线| av网站免费线看精品| 一区二区三区四区视频精品免费 | 亚洲国产一区二区在线播放| 91精品啪在线观看国产60岁| 精品亚洲成a人在线观看| 久久久三级国产网站| 激情文学综合丁香| 中文无字幕一区二区三区| 99国产精品久| 亚洲成人第一页| 久久久不卡影院| 99re视频这里只有精品| 中文字幕一区二区三区不卡| 欧美区在线观看| 狠狠久久亚洲欧美| 中文字幕一区二区三区蜜月| 欧美在线观看视频一区二区三区| 奇米色777欧美一区二区| 久久婷婷一区二区三区| 99久久国产综合精品女不卡| 日韩精品一级中文字幕精品视频免费观看 | 国产精品久久久久婷婷| 91在线观看下载| 午夜精品久久久久久久| 久久久精品中文字幕麻豆发布| 26uuu精品一区二区三区四区在线| 国产999精品久久久久久| 最新久久zyz资源站| 成人免费视频免费观看| 亚洲专区一二三| 精品国一区二区三区| 99久久综合狠狠综合久久| 亚洲成人动漫在线免费观看| 日韩你懂的在线播放| 99re8在线精品视频免费播放| 亚洲激情中文1区| 日本一区二区三区高清不卡| 欧美日韩一级片网站| 国产福利视频一区二区三区| 亚洲成人av一区二区三区| 国产精品久久久久久久久快鸭 | 国产日韩欧美亚洲| 成人国产在线观看| 欧美bbbbb| 国产午夜精品久久久久久免费视 | 亚洲精品在线一区二区| 色综合久久88色综合天天免费| 麻豆免费精品视频| 亚洲成人你懂的| 国产精品久久二区二区| 精品国产乱子伦一区| 在线一区二区视频| 国产高清亚洲一区| 日本欧美在线观看| 亚洲欧美区自拍先锋| 久久精品亚洲精品国产欧美kt∨| 欧美午夜影院一区| 99re免费视频精品全部| 国产精品香蕉一区二区三区| 亚洲天堂免费在线观看视频| 欧美精品一区二区三区蜜桃 | 亚洲最快最全在线视频| 国产丝袜美腿一区二区三区| 91极品美女在线| 国产福利电影一区二区三区| 亚洲日本青草视频在线怡红院 | 国产精品亚洲一区二区三区在线 | 精品国产乱码久久久久久牛牛 | 亚洲综合免费观看高清完整版在线 | 国产日韩欧美精品一区| 在线不卡欧美精品一区二区三区| av在线播放成人| 成人一区二区三区中文字幕| 久久99热国产| 蜜桃一区二区三区四区| 婷婷久久综合九色综合绿巨人| 国产精品久久久久天堂| 国产精品久久免费看| 久久精品欧美一区二区三区不卡| 精品免费日韩av| 欧美一区二区三区精品| 欧美一区二区成人| 777亚洲妇女| 色婷婷一区二区三区四区| 成人白浆超碰人人人人| 粉嫩高潮美女一区二区三区| 国产在线视频不卡二| 另类小说综合欧美亚洲| 麻豆91小视频| 国产一区二区三区在线观看免费视频 | 色久综合一二码| 中文字幕中文乱码欧美一区二区| 国产精品亚洲人在线观看| 久久亚洲一区二区三区四区| 成人app下载| 亚洲色图色小说| 91亚洲精品久久久蜜桃| 中文字幕在线视频一区| 6080亚洲精品一区二区| 国产成人久久精品77777最新版本| 日本成人在线一区| 精品一区精品二区高清| 韩国精品在线观看| www.视频一区| 色悠悠久久综合| 欧美日韩国产高清一区二区| 欧美精品在线一区二区| 欧美日韩国产片| 日韩女优av电影| 久久久久久久综合日本| 亚洲欧美在线视频| 一区二区三区不卡在线观看| 热久久久久久久| 国产最新精品免费| 91丨九色丨国产丨porny| 在线免费不卡电影| 亚洲女同ⅹxx女同tv| 欧美日韩免费在线视频| 精品一区二区三区在线播放|