Print line number with data file error
diff --git a/tests/scripts/generate_test_code.py b/tests/scripts/generate_test_code.py
index 22066f7..c62b5b9 100755
--- a/tests/scripts/generate_test_code.py
+++ b/tests/scripts/generate_test_code.py
@@ -421,8 +421,9 @@
# Blank line indicates end of test
if len(line) == 0:
if state == STATE_READ_ARGS:
- raise GeneratorInputError("Newline before arguments. " \
- "Test function and arguments missing for %s" % name)
+ raise GeneratorInputError("[%s:%d] Newline before arguments. " \
+ "Test function and arguments missing for %s" % \
+ (data_f.name, data_f.line_no, name))
continue
if state == STATE_READ_NAME:
@@ -443,8 +444,9 @@
deps = []
state = STATE_READ_NAME
if state == STATE_READ_ARGS:
- raise GeneratorInputError("Newline before arguments. " \
- "Test function and arguments missing for %s" % name)
+ raise GeneratorInputError("[%s:%d] Newline before arguments. " \
+ "Test function and arguments missing for %s" % \
+ (data_f.name, data_f.line_no, name))
def gen_dep_check(dep_id, dep):
@@ -650,7 +652,7 @@
out_data_file.replace('\\', '\\\\')) # escape '\'
# 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)
snippets['functions_code'] = func_code
snippets['dispatch_code'] = dispatch_code