testdefinitionparser.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <errno.h>
#include <string.h>
#include <libxml/xmlreader.h>
#include <libxml/xmlschemas.h>
#include "testrunnerlite.h"
#include "testdefinitiondatatypes.h"
#include "testdefinitionparser.h"
#include "log.h"

Go to the source code of this file.

Functions

LOCAL int td_parse_gen_attribs (td_gen_attribs *, td_gen_attribs *)
LOCAL int td_parse_suite (void)
LOCAL int td_parse_steps (xmlListPtr, const char *)
LOCAL td_steptd_parse_step (void)
LOCAL int td_parse_case (td_set *s)
LOCAL int td_parse_environments (xmlListPtr)
LOCAL int td_parse_gets (xmlListPtr)
LOCAL int td_parse_set ()
int parse_test_definition (testrunner_lite_options *opts)
int td_reader_init (testrunner_lite_options *opts)
void td_reader_close ()
int td_next_node (void)
int td_register_callbacks (td_parser_callbacks *pcbs)

Variables

LOCAL td_parser_callbackscbs
LOCAL xmlTextReaderPtr reader
LOCAL xmlSchemaParserCtxtPtr schema_context = NULL
LOCAL xmlSchemaPtr schema = NULL
LOCAL td_suitecurrent_suite


Function Documentation

int parse_test_definition ( testrunner_lite_options opts  ) 

parse testdefinition xml file and validate it agains testdefinition schema

Parameters:
opts testrunner-lite options given by user
Returns:
0 if validation is succesfull

Definition at line 562 of file testdefinitionparser.c.

int td_next_node ( void   ) 

Process next node from XML reader instance.

Returns:
0 on success

Definition at line 713 of file testdefinitionparser.c.

LOCAL int td_parse_case ( td_set s  ) 

Parse test case and insert to set list of cases.

Parameters:
*s td_set structure
Returns:
0 on success, 1 on error

Definition at line 305 of file testdefinitionparser.c.

LOCAL int td_parse_environments ( xmlListPtr  list  ) 

Parse set environments and save them in list

Parameters:
list used for saving the enabled environments
Returns:
0 on success, 1 on error

Definition at line 372 of file testdefinitionparser.c.

LOCAL int td_parse_gen_attribs ( td_gen_attribs attr,
td_gen_attribs defaults 
)

Definition at line 104 of file testdefinitionparser.c.

LOCAL int td_parse_gets ( xmlListPtr  list  ) 

Parse get-element, add filenames to list

Parameters:
list used for saving "get" filenames
Returns:
0 on success, 1 on error

Definition at line 420 of file testdefinitionparser.c.

LOCAL int td_parse_set (  ) 

Read test set in to td_set data structure and call pass it to callback

Returns:
0 on success

Definition at line 497 of file testdefinitionparser.c.

LOCAL td_step * td_parse_step (  ) 

Parse one step

Returns:
*td_step on success, NULL on error

Definition at line 171 of file testdefinitionparser.c.

LOCAL int td_parse_steps ( xmlListPtr  list,
const char *  tag 
)

Parse step elements ([pre|post]_step and save them in list

Parameters:
list list into which the steps are to be inserted
tag element name
Returns:
0 on success, 1 on error

Definition at line 240 of file testdefinitionparser.c.

LOCAL int td_parse_suite (  ) 

Read test suite in to td_suite data structure and call pass it to callback

Returns:
0 on success

Definition at line 472 of file testdefinitionparser.c.

void td_reader_close ( void   ) 

De-init the reader instance

Definition at line 703 of file testdefinitionparser.c.

int td_reader_init ( testrunner_lite_options opts  ) 

Initialize the xml reader instance

Parameters:
opts testrunner-lite options given by user
Returns:
0 on success

Definition at line 651 of file testdefinitionparser.c.

int td_register_callbacks ( td_parser_callbacks pcbs  ) 

Set the callbacks for parser

Returns:
0 (always so far)

Definition at line 750 of file testdefinitionparser.c.


Variable Documentation

Definition at line 65 of file testdefinitionparser.c.

Definition at line 69 of file testdefinitionparser.c.

LOCAL xmlTextReaderPtr reader

Definition at line 66 of file testdefinitionparser.c.

LOCAL xmlSchemaPtr schema = NULL

Definition at line 68 of file testdefinitionparser.c.

LOCAL xmlSchemaParserCtxtPtr schema_context = NULL

Definition at line 67 of file testdefinitionparser.c.


Generated on Tue Jul 27 01:28:56 2010 for testrunner-lite by  doxygen 1.5.6