mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-28 19:21:08 +00:00
Print line number with data file error
This commit is contained in:
parent
3b06f226e9
commit
8f6e8cfcc7
@ -421,8 +421,9 @@ def parse_test_data(data_f, debug=False):
|
|||||||
# Blank line indicates end of test
|
# Blank line indicates end of test
|
||||||
if len(line) == 0:
|
if len(line) == 0:
|
||||||
if state == STATE_READ_ARGS:
|
if state == STATE_READ_ARGS:
|
||||||
raise GeneratorInputError("Newline before arguments. " \
|
raise GeneratorInputError("[%s:%d] Newline before arguments. " \
|
||||||
"Test function and arguments missing for %s" % name)
|
"Test function and arguments missing for %s" % \
|
||||||
|
(data_f.name, data_f.line_no, name))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if state == STATE_READ_NAME:
|
if state == STATE_READ_NAME:
|
||||||
@ -443,8 +444,9 @@ def parse_test_data(data_f, debug=False):
|
|||||||
deps = []
|
deps = []
|
||||||
state = STATE_READ_NAME
|
state = STATE_READ_NAME
|
||||||
if state == STATE_READ_ARGS:
|
if state == STATE_READ_ARGS:
|
||||||
raise GeneratorInputError("Newline before arguments. " \
|
raise GeneratorInputError("[%s:%d] Newline before arguments. " \
|
||||||
"Test function and arguments missing for %s" % name)
|
"Test function and arguments missing for %s" % \
|
||||||
|
(data_f.name, data_f.line_no, name))
|
||||||
|
|
||||||
|
|
||||||
def gen_dep_check(dep_id, dep):
|
def gen_dep_check(dep_id, dep):
|
||||||
@ -650,7 +652,7 @@ def generate_code(funcs_file, data_file, template_file, platform_file, help_file
|
|||||||
out_data_file.replace('\\', '\\\\')) # escape '\'
|
out_data_file.replace('\\', '\\\\')) # escape '\'
|
||||||
|
|
||||||
# Function code
|
# Function code
|
||||||
with FileWrapper(funcs_file) as funcs_f, open(data_file, 'r') as data_f, open(out_data_file, 'w') as out_data_f:
|
with FileWrapper(funcs_file) as funcs_f, FileWrapper(data_file) as data_f, open(out_data_file, 'w') as out_data_f:
|
||||||
suite_deps, dispatch_code, func_code, func_info = parse_functions(funcs_f)
|
suite_deps, dispatch_code, func_code, func_info = parse_functions(funcs_f)
|
||||||
snippets['functions_code'] = func_code
|
snippets['functions_code'] = func_code
|
||||||
snippets['dispatch_code'] = dispatch_code
|
snippets['dispatch_code'] = dispatch_code
|
||||||
|
Loading…
x
Reference in New Issue
Block a user