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 xmlChar *hwid; 00059 } td_gen_attribs; 00060 /* ------------------------------------------------------------------------- */ 00062 typedef struct { 00063 xmlChar *hw_detector; 00064 xmlChar *detected_hw; 00065 } td_td; 00066 /* ------------------------------------------------------------------------- */ 00068 typedef struct { 00069 td_gen_attribs gen; 00070 int filtered; 00071 } td_suite; 00072 /* ------------------------------------------------------------------------- */ 00074 typedef struct { 00075 int delete_after; 00076 xmlChar *filename; 00077 } td_file; 00078 /* ------------------------------------------------------------------------- */ 00080 typedef struct { 00081 td_gen_attribs gen; 00082 xmlListPtr pre_steps; 00083 xmlListPtr post_steps; 00084 xmlListPtr cases; 00085 xmlListPtr environments; 00086 xmlListPtr gets; 00087 int filtered; 00088 /* Executor fills */ 00089 xmlChar *environment; 00090 } td_set; 00091 /* ------------------------------------------------------------------------- */ 00093 typedef struct { 00094 /* Parser fills */ 00095 xmlChar *step; 00097 int has_expected_result; 00098 int expected_result; 00099 int has_result; 00100 int return_code; 00101 int manual; 00103 /* Executor fills */ 00104 xmlChar *failure_info; 00105 time_t start; 00106 time_t end; 00107 xmlChar *stdout_; 00108 xmlChar *stderr_; 00109 pid_t pgid; 00110 pid_t pid; 00111 } td_step; 00112 /* ------------------------------------------------------------------------- */ 00114 typedef enum { 00115 CASE_FAIL = 0, 00116 CASE_PASS, 00117 CASE_NA 00118 } case_result_t; 00119 /* ------------------------------------------------------------------------- */ 00121 typedef struct { 00122 /* Parser fills */ 00123 td_gen_attribs gen; 00124 xmlChar *subfeature; 00125 xmlListPtr steps; 00126 xmlChar *tc_title; 00127 xmlChar *state; 00128 /* Executor fills */ 00129 xmlChar *comment; 00130 case_result_t case_res; 00131 xmlChar *failure_info; 00132 int dummy; 00133 int filtered; 00134 } td_case; 00135 /* ------------------------------------------------------------------------- */ 00137 typedef struct { 00138 xmlListPtr steps; 00139 unsigned long timeout; 00140 } td_steps; 00141 /* ------------------------------------------------------------------------- */ 00142 /* FORWARD DECLARATIONS */ 00143 /* None */ 00144 00145 /* ------------------------------------------------------------------------- */ 00146 /* STRUCTURES */ 00147 /* None */ 00148 00149 /* ------------------------------------------------------------------------- */ 00150 /* FUNCTION PROTOTYPES */ 00151 /* ------------------------------------------------------------------------- */ 00152 const char *case_result_str (case_result_t); 00153 /* ------------------------------------------------------------------------- */ 00154 td_td *td_td_create(); 00155 /* ------------------------------------------------------------------------- */ 00156 void td_td_delete(td_td *); 00157 /* ------------------------------------------------------------------------- */ 00158 td_suite *td_suite_create(); 00159 /* ------------------------------------------------------------------------- */ 00160 void td_suite_delete(td_suite *); 00161 /* ------------------------------------------------------------------------- */ 00162 td_set *td_set_create(); 00163 /* ------------------------------------------------------------------------- */ 00164 void td_set_delete(td_set *); 00165 /* ------------------------------------------------------------------------- */ 00166 td_step *td_step_create(); 00167 /* ------------------------------------------------------------------------- */ 00168 void td_step_delete(xmlLinkPtr); 00169 /* ------------------------------------------------------------------------- */ 00170 td_case *td_case_create(); 00171 /* ------------------------------------------------------------------------- */ 00172 void td_case_delete(xmlLinkPtr); 00173 /* ------------------------------------------------------------------------- */ 00174 td_steps *td_steps_create(); 00175 /* ------------------------------------------------------------------------- */ 00176 void td_steps_delete(xmlLinkPtr); 00177 /* ------------------------------------------------------------------------- */ 00178 #endif /* TESTDEFINITIONDATATYPES_H */ 00179 /* End of file */