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 (int manual_default)
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
LOCAL td_setcurrent_set


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 608 of file testdefinitionparser.c.

int td_next_node ( void   ) 

Process next node from XML reader instance.

Returns:
0 on success

Definition at line 759 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 331 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 426 of file testdefinitionparser.c.

LOCAL int td_parse_gen_attribs ( td_gen_attribs attr,
td_gen_attribs defaults 
)

Definition at line 105 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 474 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 547 of file testdefinitionparser.c.

LOCAL td_step * td_parse_step ( int  manual_default  ) 

Parse one step

Returns:
*td_step on success, NULL on error

Definition at line 186 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 266 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 526 of file testdefinitionparser.c.

void td_reader_close ( void   ) 

De-init the reader instance

Definition at line 749 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 697 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 796 of file testdefinitionparser.c.


Variable Documentation

Definition at line 65 of file testdefinitionparser.c.

Definition at line 70 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 Mon Sep 27 22:14:57 2010 for testrunner-lite by  doxygen 1.5.6