Lhogho
0.0.028
|
Go to the source code of this file.
Functions | |
RESULT | parse_line (FILE *input_file, TCHAR **parameter_name, TCHAR **parameter_optipons) |
Parse a comment line in the test case file. More... | |
RESULT | extract_args (FILE *input_file, test_case_info *test_info) |
Extracts all argument pairs from test case file. More... | |
static RESULT | write_one_line_result (const TCHAR *result, FILE *out_file) |
Writes a line to the expected result file. More... | |
RESULT | extract_expected_results (FILE *input_file, const char *file_name) |
Extract value for expected results from test case file. More... | |
RESULT | execute_test (const char *file_name, test_case_info test_info) |
Execute a test case. More... | |
RESULT | compile_test (const char *file_name, test_case_info test_info) |
Compile test case file to executable. More... | |
static RESULT | get_file_size (const char *file_name, UINT64 *size_ptr) |
Calculate file size. More... | |
RESULT | check_results (const char *file_name, test_case_info test_info, UINT32 exec_result) |
Check results from test case execution. More... | |
RESULT | import_results (const char *file_name, test_case_info test_info) |
Import results from test execution into test case file. More... | |
void | clean_up (const char *file_name) |
Clean up any temporary data from test execution. More... | |
void | print_file (const char *file_name, FILE *output_file) |
prints a file to the end of another one More... | |
static RESULT | compare_strings_output (const TCHAR *test_line, const TCHAR *expected_line) |
Compare result strings. More... | |
RESULT | file_compare (const char *test_file_name, test_case_info test_info) |
Compare result file with one expected. More... | |
RESULT | exec_shell (const char *file_name) |
Execute a shell script with name same as test file name. More... | |
Variables | |
int | g_first |
input_file | file to read from |
parameter_name | name of the parameter readed |
parameter_optipons | pointer to data assigned to the parameter |
Read a comment line from test case file. If line describes valid parameter-value pair assignes name of parameter to parameter_name
and option value to parameter_optipons
Allocates memory for them. If line is empty return SUCCESS_EMPTY
value If other error occurs return some error value.
Definition at line 51 of file tester_internal.c.
RESULT extract_args | ( | FILE * | input_file, |
test_case_info * | test_info | ||
) |
input_file | file to read from |
test_info | struct in which data from parameters will be writen |
Reads comment lines from the source file until empty is found For each extracts data and call all registered parsers. Each of them is responsible to process parameter or return ERR_INVALID_ARG
if doesn't recognise the param name
Definition at line 142 of file tester_internal.c.
result | line to be written |
out_file | file to write in |
Write a line extracted from test case file to the file containing expected results. Perform some processing on it such as skiping comment symbol.
Definition at line 191 of file tester_internal.c.
RESULT extract_expected_results | ( | FILE * | input_file, |
const char * | file_name | ||
) |
input_file | Test case file |
file_name | name of the file |
Read lines with expected results from test case file until empty found. Write them after corresponding processment to the file with name similar to file_name
but with specified suffix.
Definition at line 223 of file tester_internal.c.
RESULT execute_test | ( | const char * | file_name, |
test_case_info | test_info | ||
) |
file_name | Test case file name |
test_info | Options for execution |
RESULT
valuePrepare shell comand line calling tested application and execute it. Depending on testing mode could perform different actions. Collect stdout output and return execution success code as SUCCESS result
Definition at line 267 of file tester_internal.c.
RESULT compile_test | ( | const char * | file_name, |
test_case_info | test_info | ||
) |
file_name | Test case file name |
test_info | Options for execution |
Calls external compiler to compile test file.
Definition at line 356 of file tester_internal.c.
file_name | name of input file |
size_ptr | pointer to the file size. |
Determine size of file given by file name.
Definition at line 404 of file tester_internal.c.
RESULT check_results | ( | const char * | file_name, |
test_case_info | test_info, | ||
UINT32 | exec_result | ||
) |
file_name | name of tested file |
test_info | options for execution |
exec_result | return value from execution |
Checks results from test execution and compare them with expected.
Definition at line 426 of file tester_internal.c.
RESULT import_results | ( | const char * | file_name, |
test_case_info | test_info | ||
) |
file_name | name of tested file |
test_info | options for execution |
Import results from test execution into test case file.
Definition at line 501 of file tester_internal.c.
void clean_up | ( | const char * | file_name) |
file_name | name of tested file |
Remove any temporary files produced from test execution process
Definition at line 572 of file tester_internal.c.
void print_file | ( | const char * | file_name, |
FILE * | output_file | ||
) |
file_name | name of file to be printed |
output_file | file where data will be appended |
Appends contet of input file into end of destination file
Definition at line 599 of file tester_internal.c.
test_line | line produced from test case |
expected_line | line expected to be produced |
Compare produced from tester data with one expected to be produced. Additional processing on data and sensitiwity of comparisson may be added. Returns success value if lines are "equual" and error if tey are not
Definition at line 629 of file tester_internal.c.
RESULT file_compare | ( | const char * | test_file_name, |
test_case_info | test_info | ||
) |
test_file_name | name of tested file |
test_info | parameters for test execution |
Compare file containing produced from tester data with file containing expected data Returns success value if lines are "equual" and error if tey are not
Definition at line 682 of file tester_internal.c.
RESULT exec_shell | ( | const char * | file_name) |
file_name | name of tested file |
Try to execute shell script with name same as input file if any. If no script exist return SUCCESS_FILE else return SUCESS_FULL on successfull execution of ERR_GENERIC on error.
Definition at line 803 of file tester_internal.c.
int g_first |
Definition at line 34 of file tester_internal.c.