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_td (void)
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 ()
LOCAL int td_parse_hwiddetect ()
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_tdcurrent_td
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 667 of file testdefinitionparser.c.

int td_next_node ( void   ) 

Process next node from XML reader instance.

Returns:
0 on success

Definition at line 818 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 344 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 439 of file testdefinitionparser.c.

LOCAL int td_parse_gen_attribs ( td_gen_attribs attr,
td_gen_attribs defaults 
)

Definition at line 110 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 487 of file testdefinitionparser.c.

LOCAL int td_parse_hwiddetect (  ) 

Read hwiddetect tag, store detector command, and use callback to run it

Returns:
0 on success

Definition at line 635 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 560 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 199 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 279 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 539 of file testdefinitionparser.c.

LOCAL int td_parse_td (  ) 

Create test definition data type and call callback function

Returns:
0 on success

Definition at line 617 of file testdefinitionparser.c.

void td_reader_close ( void   ) 

De-init the reader instance

Definition at line 808 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 756 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 871 of file testdefinitionparser.c.


Variable Documentation

Definition at line 65 of file testdefinitionparser.c.

Definition at line 71 of file testdefinitionparser.c.

Definition at line 70 of file testdefinitionparser.c.

LOCAL td_td* current_td

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 Wed Nov 10 14:13:01 2010 for testrunner-lite by  doxygen 1.5.6