#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <assert.h>
#include <string.h>
#include <math.h>
#include <curses.h>
#include "CUnit.h"
#include "TestDB.h"
#include "Util.h"
#include "TestRun.h"
#include "CUCurses.h"
Data Structures | |
struct | APPWINDOWS |
Pointers to curses interface windows. More... | |
struct | APPPAD |
Window elements. More... | |
Defines | |
#define | false (0) |
Local boolean definition for false. | |
#define | true (~false) |
Local boolean definition for true. | |
#define | STRING_LENGTH 128 |
Standard string length. | |
Enumerations | |
enum | STATUS { CONTINUE = 1, MOVE_UP, STOP } |
Curses interface status flag. More... | |
enum | MENU_TYPE { MAIN_MENU = 1, GROUP_MENU } |
Menu type. More... | |
Functions | |
bool | initialize_windows (void) |
Initialize the curses interface windows. | |
void | uninitialize_windows (void) |
Clean up and delete curses interface windows. | |
void | refresh_windows (void) |
Refresh curses interface windows. | |
void | refresh_title_window (void) |
Refresh the title window. | |
void | refresh_progress_window (void) |
Refresh the progress bar window. | |
void | refresh_summary_window (void) |
Refresh the summary window. | |
void | refresh_run_summary_window (void) |
Refresh the run summary window. | |
void | refresh_details_window (void) |
Refresh the details window. | |
void | refresh_options_window (void) |
Refresh the options window. | |
bool | create_pad (APPPAD *pPad, WINDOW *pParent, unsigned int uiRows, unsigned int uiCols) |
Create a window having specified parent and dimensions. | |
void | scroll_window (int nCommand, APPPAD *pPad, void(*parent_refresh)(void)) |
Scroll a window. | |
bool | test_initialize (void) |
Initialize the message handlers in preparation for running tests. | |
void | show_progress_bar (void) |
Show the progress bar window. | |
const char * | get_hotkey (const char *szStr, int *pPos) |
Parse a string and return the coded hotkeys. | |
void | read_input_string (const char szPropmt[], char szValue[], int nBytes) |
Display a prompt, then read a string from the keyboard. | |
STATUS | curses_registry_level_run (CU_pTestRegistry pRegistry) |
Main loop for curses interface. | |
STATUS | curses_suite_level_run (CU_pSuite pSuite) |
Run a selected suite within the curses interface. | |
CU_ErrorCode | curses_run_all_tests (CU_pTestRegistry pRegistry) |
Run all tests within the curses interface. | |
CU_ErrorCode | curses_run_suite_tests (CU_pSuite pSuite) |
Run a specified suite within the curses interface. | |
CU_ErrorCode | curses_run_single_test (CU_pSuite pSuite, CU_pTest pTest) |
Run a specific test for the specified suite within the curses interface. | |
void | curses_test_start_message_handler (const CU_pTest pTest, const CU_pSuite pSuite) |
Handler function called at start of each test. | |
void | curses_test_complete_message_handler (const CU_pTest pTest, const CU_pSuite pSuite, const CU_pFailureRecord pFailure) |
Handler function called at completion of each test. | |
void | curses_all_tests_complete_message_handler (const CU_pFailureRecord pFailure) |
Handler function called at completion of all tests in a suite. | |
void | curses_suite_init_failure_message_handler (const CU_pSuite pSuite) |
Handler function called when suite initialization fails. | |
void | list_suites (CU_pTestRegistry pRegistry) |
Print a list of registered suites in the detail window. | |
void | list_tests (CU_pSuite pSuite) |
Print a list of tests contained in a specified suite in the detail window. | |
void | show_failures (void) |
Display the record of test failures in the detail window. | |
void | reset_run_parameters (void) |
Reset the local run counters and prepare for a test run. | |
Variables | |
const char * | MAIN_OPTIONS = "(R)un (S)elect Suite (L)ist (F)ailures (Q)uit" |
String holding main menu run options. | |
const char * | SUITE_OPTIONS = "(R)un (S)elect Test (L)ist (F)ailures (U)p (Q)uit" |
String holding suite menu run options. | |
const int | CLEAR_COLOR = 1 |
Clear color. | |
const int | TITLE_COLOR = 2 |
Title color. | |
const int | PROGRESS_BACKGROUND_COLOR = 3 |
progress bar background color. | |
const int | PROGRESS_SUCCESS_COLOR = 4 |
Progress bar success color. | |
const int | PROGRESS_FAILURE_COLOR = 5 |
Progress bar failure color. | |
const int | MENU_COLOR = 6 |
Menu color. | |
const char *const | f_szProgress = "Progress " |
Test for progress bar. | |
const char * | f_szOptions = NULL |
String containing options. | |
CU_pTest | f_pCurrentTest = NULL |
Pointer to the test currently being run. | |
CU_pSuite | f_pCurrentSuite = NULL |
Pointer to the suite currently being run. | |
unsigned int | f_uiTotalTests = 0 |
Number of tests in registered suites. | |
unsigned int | f_uiTestsRun = 0 |
Number of tests actually run. | |
unsigned int | f_uiTestsSkipped = 0 |
Number of tests skipped during run. | |
unsigned int | f_uiTestsFailed = 0 |
Number of tests having failed assertions. | |
unsigned int | f_uiTestsRunSuccessful = 0 |
Number of tests run with no failed assertions. | |
unsigned int | f_uiTotalSuites = 0 |
Number of registered suites. | |
unsigned int | f_uiSuitesSkipped = 0 |
Number of suites skipped during run. | |
short | f_nLeft |
Left window position. | |
short | f_nTop |
Top window position. | |
short | f_nWidth |
Width of window. | |
short | f_nHeight |
Height of window. | |
APPWINDOWS | application_windows = {NULL, NULL, NULL, NULL, NULL, NULL, NULL} |
Pointers to curses interface windows. | |
APPPAD | details_pad = {NULL, 0, 0, 0, 0, 0, 0, 0, 0} |
Details window definition. |