Lhogho  0.0.028
 All Data Structures Files Functions Variables Typedefs Macros Pages
internal.h
Go to the documentation of this file.
1 //===================================================
2 // Project:TestSystem Author: Peter Armianov
3 //===================================================
4 //
5 // INTERNAL.H
6 //
7 // This file contains basic types and definitions
8 // for the test system.
9 //
10 // Revision history:
11 // 2007-05-14 - file created
12 // 2007-07-01 - additional working modes
13 // 2007-07-12 - additional comments in Doxygen style
14 // 2007-10-13 - Support for memory tests (-Zm option)
15 // 2009-05-30 - Support for shell tests
16 //===================================================
17 
18 #if defined(_MSC_VER)
19 # pragma once
20 #endif
21 
22 #ifndef __INTERNAL_H_8DED3586_3931_4BD5_A578_3B8B6082391C_INCLUDED
23 #define __INTERNAL_H_8DED3586_3931_4BD5_A578_3B8B6082391C_INCLUDED
24 
25 //===================================================
29 //===================================================
31 #define LOGO_NAME "lhogho"
32 #define TARGET_FILE_EXTENSION "lgo"
33 #define SHELL_FILE_EXTENSION "sh"
34 #define EXPECTED_RESULTS_EXT "expected"
35 #define REAL_RESULTS_EXT "real"
36 #define ERROR_RESULTS_EXT "stderr"
37 #define LTEMP_EXT "ltemp"
38 #define MAX_LINE_LENGTH 2048
39 #define MAX_NAME_LEN 1024
40 
41 #define EXPECTED_MEMORY TEXT("{MEM#0:0}")
42 #define MEMORY_CHECK_OPTION "-Zm"
43 
44 #define PARAM_SET_SYMBOL TEXT('=')
45 #define SPACE_ESC_SYMBOL TEXT('\"')
46 #define COMMENT_SYMBOL TEXT(';')
47 
49 //----------------------------------------------------
53 //----------------------------------------------------
55 typedef
56 struct test_case_info_tag
57 {
63 
64 
65 typedef RESULT (* parse_config_attribute_function) (const TCHAR * parameter_name,
66  const TCHAR * parameter_optipons,
67  test_case_info * test_case_params);
68 
69 //----------------------------------------------------
72 //----------------------------------------------------
74 extern int m_strcmp(const TCHAR * str1, const TCHAR * str2);
75 extern TCHAR * m_strcpy(TCHAR * dest, const TCHAR * src);
76 extern BOOL m_isspace(TCHAR chr);
77 extern RESULT m_strdup(TCHAR ** dest_ptr, const TCHAR * src);
78 extern RESULT m_strndup(TCHAR ** dest_ptr, const TCHAR * src, size_t num_chars);
79 extern size_t m_strlen(const TCHAR * str);
80 
81 extern TCHAR * m_fgets(FILE* file, TCHAR * buffer, size_t buffer_size, size_t * out_size_ptr);
82 extern void m_fputs(FILE* file, const TCHAR * buffer);
83 extern void m_fputs_ascii(FILE* file, const char * buffer);
84 extern void m_fputc(FILE* file, TCHAR tchar);
86 
87 //----------------------------------------------------
90 //----------------------------------------------------
92 extern RESULT parse_line(FILE * input_file, TCHAR ** parameter_name, TCHAR ** parameter_optipons);
93 extern RESULT extract_args(FILE * input_file, test_case_info * test_info);
94 extern RESULT extract_expected_results(FILE * input_file, const char * file_name);
95 extern RESULT execute_test(const char * file_name, test_case_info test_info);
96 extern RESULT compile_test(const char * file_name, test_case_info test_info);
97 extern RESULT check_results(const char * file_name, test_case_info test_info, UINT32 exec_result);
98 extern RESULT import_results(const char * file_name, test_case_info test_info);
99 extern void clean_up(const char * file_name);
100 extern void print_file(const char * file_name, FILE * output);
101 extern RESULT file_compare(const char * test_file_name, test_case_info test_info);
102 extern RESULT exec_shell(const char * file_name);
104 
105 
106 extern int g_first;
107 #endif /* __INTERNAL_H_8DED3586_3931_4BD5_A578_3B8B6082391C_INCLUDED */
108 

[ HOME | INDEX | ATOMS | VARS | REFERENCE ]
Lhogho Developer's Documentation
Wed Jul 10 2013