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 int manual; 00053 int insignificant; 00054 } td_gen_attribs; 00055 /* ------------------------------------------------------------------------- */ 00057 typedef struct { 00058 td_gen_attribs gen; 00059 xmlChar *domain; 00060 int filtered; 00061 } td_suite; 00062 /* ------------------------------------------------------------------------- */ 00064 typedef struct { 00065 int delete_after; 00066 xmlChar *filename; 00067 } td_file; 00068 /* ------------------------------------------------------------------------- */ 00070 typedef struct { 00071 td_gen_attribs gen; 00072 xmlChar *feature; 00073 xmlListPtr pre_steps; 00074 xmlListPtr post_steps; 00075 xmlListPtr cases; 00076 xmlListPtr environments; 00077 xmlListPtr gets; 00078 int filtered; 00079 /* Executor fills */ 00080 xmlChar *environment; 00081 } td_set; 00082 /* ------------------------------------------------------------------------- */ 00084 typedef struct { 00085 /* Parser fills */ 00086 xmlChar *step; 00088 int has_expected_result; 00089 int expected_result; 00090 int has_result; 00091 int return_code; 00092 /* Executor fills */ 00093 xmlChar *failure_info; 00094 time_t start; 00095 time_t end; 00096 xmlChar *stdout_; 00097 xmlChar *stderr_; 00098 pid_t pgid; 00099 pid_t pid; 00100 } td_step; 00101 /* ------------------------------------------------------------------------- */ 00103 typedef enum { 00104 CASE_FAIL = 0, 00105 CASE_PASS, 00106 CASE_NA 00107 } case_result_t; 00108 /* ------------------------------------------------------------------------- */ 00110 typedef struct { 00111 /* Parser fills */ 00112 td_gen_attribs gen; 00113 xmlChar *subfeature; 00114 xmlListPtr steps; 00115 xmlChar *comment; 00116 /* Executor fills */ 00117 case_result_t case_res; 00118 xmlChar *failure_info; 00119 int dummy; 00120 int filtered; 00121 } td_case; 00122 /* ------------------------------------------------------------------------- */ 00124 typedef struct { 00125 xmlListPtr steps; 00126 unsigned long timeout; 00127 } td_steps; 00128 /* ------------------------------------------------------------------------- */ 00129 /* FORWARD DECLARATIONS */ 00130 /* None */ 00131 00132 /* ------------------------------------------------------------------------- */ 00133 /* STRUCTURES */ 00134 /* None */ 00135 00136 /* ------------------------------------------------------------------------- */ 00137 /* FUNCTION PROTOTYPES */ 00138 /* ------------------------------------------------------------------------- */ 00139 const char *case_result_str (case_result_t); 00140 /* ------------------------------------------------------------------------- */ 00141 td_suite *td_suite_create(); 00142 /* ------------------------------------------------------------------------- */ 00143 void td_suite_delete(td_suite *); 00144 /* ------------------------------------------------------------------------- */ 00145 td_set *td_set_create(); 00146 /* ------------------------------------------------------------------------- */ 00147 void td_set_delete(td_set *); 00148 /* ------------------------------------------------------------------------- */ 00149 td_step *td_step_create(); 00150 /* ------------------------------------------------------------------------- */ 00151 void td_step_delete(xmlLinkPtr); 00152 /* ------------------------------------------------------------------------- */ 00153 td_case *td_case_create(); 00154 /* ------------------------------------------------------------------------- */ 00155 void td_case_delete(xmlLinkPtr); 00156 /* ------------------------------------------------------------------------- */ 00157 td_steps *td_steps_create(); 00158 /* ------------------------------------------------------------------------- */ 00159 void td_steps_delete(xmlLinkPtr); 00160 /* ------------------------------------------------------------------------- */ 00161 #endif /* TESTDEFINITIONDATATYPES_H */ 00162 /* End of file */