00001 /* 00002 * This file is part of testrunner-lite 00003 * 00004 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00005 * 00006 * Contact: Sampo Saaristo <ext-sampo.2.saaristo@nokia.com> 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * version 2.1 as published by the Free Software Foundation. 00011 * 00012 * This program is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00020 * 02110-1301 USA 00021 * 00022 */ 00023 00024 #ifndef TESTDEFINITIONDATATYPES_H 00025 #define TESTDEFINITIONDATATYPES_H 00026 00027 /* ------------------------------------------------------------------------- */ 00028 /* INCLUDES */ 00029 #include <sys/time.h> 00030 #include <libxml/xmlstring.h> 00031 #include <libxml/list.h> 00032 #include "testrunnerlite.h" 00033 00034 /* ------------------------------------------------------------------------- */ 00035 /* CONSTANTS */ 00036 /* None */ 00037 00038 /* ------------------------------------------------------------------------- */ 00039 /* MACROS */ 00040 00041 /* ------------------------------------------------------------------------- */ 00042 /* DATA TYPES */ 00043 /* ------------------------------------------------------------------------- */ 00045 typedef struct { 00046 xmlChar *name; 00047 xmlChar *description; 00048 xmlChar *requirement; 00049 xmlChar *type; 00050 unsigned long timeout; 00051 xmlChar *level; 00052 xmlChar *domain; 00053 xmlChar *feature; 00054 xmlChar *component; 00056 int manual; 00057 int insignificant; 00058 } td_gen_attribs; 00059 /* ------------------------------------------------------------------------- */ 00061 typedef struct { 00062 td_gen_attribs gen; 00063 int filtered; 00064 } td_suite; 00065 /* ------------------------------------------------------------------------- */ 00067 typedef struct { 00068 int delete_after; 00069 xmlChar *filename; 00070 } td_file; 00071 /* ------------------------------------------------------------------------- */ 00073 typedef struct { 00074 td_gen_attribs gen; 00075 xmlListPtr pre_steps; 00076 xmlListPtr post_steps; 00077 xmlListPtr cases; 00078 xmlListPtr environments; 00079 xmlListPtr gets; 00080 int filtered; 00081 /* Executor fills */ 00082 xmlChar *environment; 00083 } td_set; 00084 /* ------------------------------------------------------------------------- */ 00086 typedef struct { 00087 /* Parser fills */ 00088 xmlChar *step; 00090 int has_expected_result; 00091 int expected_result; 00092 int has_result; 00093 int return_code; 00094 int manual; 00096 /* Executor fills */ 00097 xmlChar *failure_info; 00098 time_t start; 00099 time_t end; 00100 xmlChar *stdout_; 00101 xmlChar *stderr_; 00102 pid_t pgid; 00103 pid_t pid; 00104 } td_step; 00105 /* ------------------------------------------------------------------------- */ 00107 typedef enum { 00108 CASE_FAIL = 0, 00109 CASE_PASS, 00110 CASE_NA 00111 } case_result_t; 00112 /* ------------------------------------------------------------------------- */ 00114 typedef struct { 00115 /* Parser fills */ 00116 td_gen_attribs gen; 00117 xmlChar *subfeature; 00118 xmlListPtr steps; 00119 xmlChar *tc_title; 00120 xmlChar *state; 00121 /* Executor fills */ 00122 xmlChar *comment; 00123 case_result_t case_res; 00124 xmlChar *failure_info; 00125 int dummy; 00126 int filtered; 00127 } td_case; 00128 /* ------------------------------------------------------------------------- */ 00130 typedef struct { 00131 xmlListPtr steps; 00132 unsigned long timeout; 00133 } td_steps; 00134 /* ------------------------------------------------------------------------- */ 00135 /* FORWARD DECLARATIONS */ 00136 /* None */ 00137 00138 /* ------------------------------------------------------------------------- */ 00139 /* STRUCTURES */ 00140 /* None */ 00141 00142 /* ------------------------------------------------------------------------- */ 00143 /* FUNCTION PROTOTYPES */ 00144 /* ------------------------------------------------------------------------- */ 00145 const char *case_result_str (case_result_t); 00146 /* ------------------------------------------------------------------------- */ 00147 td_suite *td_suite_create(); 00148 /* ------------------------------------------------------------------------- */ 00149 void td_suite_delete(td_suite *); 00150 /* ------------------------------------------------------------------------- */ 00151 td_set *td_set_create(); 00152 /* ------------------------------------------------------------------------- */ 00153 void td_set_delete(td_set *); 00154 /* ------------------------------------------------------------------------- */ 00155 td_step *td_step_create(); 00156 /* ------------------------------------------------------------------------- */ 00157 void td_step_delete(xmlLinkPtr); 00158 /* ------------------------------------------------------------------------- */ 00159 td_case *td_case_create(); 00160 /* ------------------------------------------------------------------------- */ 00161 void td_case_delete(xmlLinkPtr); 00162 /* ------------------------------------------------------------------------- */ 00163 td_steps *td_steps_create(); 00164 /* ------------------------------------------------------------------------- */ 00165 void td_steps_delete(xmlLinkPtr); 00166 /* ------------------------------------------------------------------------- */ 00167 #endif /* TESTDEFINITIONDATATYPES_H */ 00168 /* End of file */
1.5.6