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 <sampo.saaristo@sofica.fi> 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 #define DEFAULT_TIMEOUT 90 00051 unsigned long timeout; 00052 xmlChar *level; 00053 xmlChar *domain; 00054 xmlChar *feature; 00055 xmlChar *component; 00057 int manual; 00058 int insignificant; 00059 xmlChar *hwid; 00060 } td_gen_attribs; 00061 /* ------------------------------------------------------------------------- */ 00063 typedef struct { 00064 /* parser fills */ 00065 xmlChar *hw_detector; 00066 xmlChar *description; 00067 xmlChar *version; 00068 /* executor fills */ 00069 xmlChar *detected_hw; 00070 } td_td; 00071 /* ------------------------------------------------------------------------- */ 00073 typedef struct { 00074 td_gen_attribs gen; 00075 xmlChar *description; 00076 int filtered; 00077 } td_suite; 00078 /* ------------------------------------------------------------------------- */ 00080 typedef struct { 00081 int delete_after; 00082 xmlChar *filename; 00083 } td_file; 00084 /* ------------------------------------------------------------------------- */ 00086 typedef struct { 00087 td_gen_attribs gen; 00088 xmlListPtr pre_steps; 00089 xmlListPtr post_steps; 00090 xmlListPtr cases; 00091 xmlListPtr environments; 00092 xmlListPtr gets; 00093 int filtered; 00094 xmlChar *description; 00095 /* Executor fills */ 00096 xmlChar *environment; 00097 } td_set; 00098 /* ------------------------------------------------------------------------- */ 00100 typedef struct { 00101 /* Parser fills */ 00102 xmlChar *step; 00104 int has_expected_result; 00105 int expected_result; 00106 int has_result; 00107 int return_code; 00108 int manual; 00110 /* Executor fills */ 00111 xmlChar *failure_info; 00112 time_t start; 00113 time_t end; 00114 xmlChar *stdout_; 00115 xmlChar *stderr_; 00116 pid_t pgid; 00117 pid_t pid; 00118 } td_step; 00119 /* ------------------------------------------------------------------------- */ 00121 typedef enum { 00122 CASE_FAIL = 0, 00123 CASE_PASS, 00124 CASE_NA 00125 } case_result_t; 00126 /* ------------------------------------------------------------------------- */ 00128 typedef struct { 00129 /* Parser fills */ 00130 td_gen_attribs gen; 00131 xmlChar *subfeature; 00132 xmlListPtr steps; 00133 xmlChar *tc_id; 00134 xmlChar *state; 00135 xmlChar *bugzilla_id; 00137 xmlChar *description; 00138 /* Executor fills */ 00139 xmlChar *comment; 00140 case_result_t case_res; 00141 xmlChar *failure_info; 00142 int dummy; 00143 int filtered; 00144 } td_case; 00145 /* ------------------------------------------------------------------------- */ 00147 typedef struct { 00148 xmlListPtr steps; 00149 #define DEFAULT_PRE_STEP_TIMEOUT 180 00150 unsigned long timeout; 00151 } td_steps; 00152 /* ------------------------------------------------------------------------- */ 00153 /* FORWARD DECLARATIONS */ 00154 /* None */ 00155 00156 /* ------------------------------------------------------------------------- */ 00157 /* STRUCTURES */ 00158 /* None */ 00159 00160 /* ------------------------------------------------------------------------- */ 00161 /* FUNCTION PROTOTYPES */ 00162 /* ------------------------------------------------------------------------- */ 00163 const char *case_result_str (case_result_t); 00164 /* ------------------------------------------------------------------------- */ 00165 td_td *td_td_create(); 00166 /* ------------------------------------------------------------------------- */ 00167 void td_td_delete(td_td *); 00168 /* ------------------------------------------------------------------------- */ 00169 td_suite *td_suite_create(); 00170 /* ------------------------------------------------------------------------- */ 00171 void td_suite_delete(td_suite *); 00172 /* ------------------------------------------------------------------------- */ 00173 td_set *td_set_create(); 00174 /* ------------------------------------------------------------------------- */ 00175 void td_set_delete(td_set *); 00176 /* ------------------------------------------------------------------------- */ 00177 td_step *td_step_create(); 00178 /* ------------------------------------------------------------------------- */ 00179 void td_step_delete(xmlLinkPtr); 00180 /* ------------------------------------------------------------------------- */ 00181 td_case *td_case_create(); 00182 /* ------------------------------------------------------------------------- */ 00183 void td_case_delete(xmlLinkPtr); 00184 /* ------------------------------------------------------------------------- */ 00185 td_steps *td_steps_create(); 00186 /* ------------------------------------------------------------------------- */ 00187 void td_steps_delete(xmlLinkPtr); 00188 /* ------------------------------------------------------------------------- */ 00189 #endif /* TESTDEFINITIONDATATYPES_H */ 00190 /* End of file */
1.6.3