show now correct file path, test name and line number
This commit is contained in:
10
src/kunity.c
10
src/kunity.c
@@ -77,7 +77,7 @@ result_code_e create_default_test_output(/* out*/ ptr_output_functions_s* output
|
||||
return OK;
|
||||
}
|
||||
|
||||
result_code_e run_unity_test(/* in */ const unity_test_function_ptr test_function, /* in */ const ptr_output_functions_s output)
|
||||
result_code_e run_unity_test(/* in */ const unity_test_function_ptr test_function, /* in */ const char* file_name, /* in */ const char* test_name, /* in */ int line_number, /* in */ const ptr_output_functions_s output)
|
||||
{
|
||||
result_code_e result;
|
||||
if (output == NULL) {
|
||||
@@ -89,15 +89,15 @@ result_code_e run_unity_test(/* in */ const unity_test_function_ptr test_functio
|
||||
return result;
|
||||
}
|
||||
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_function);
|
||||
UnityBegin(file_name);
|
||||
UnityDefaultTestRun(test_function, test_name, line_number);
|
||||
UNITY_END();
|
||||
return result;
|
||||
}
|
||||
|
||||
result_code_e run_unity_printk_test(/* in */ const unity_test_function_ptr test_function)
|
||||
result_code_e run_unity_printk_test(/* in */ const unity_test_function_ptr test_function, /* in */ const char* file_name, /* in */ const char* test_name, /* in */ int line_number)
|
||||
{
|
||||
return run_unity_test(test_function, &prink_output);
|
||||
return run_unity_test(test_function, file_name, test_name, line_number, &prink_output);
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
@@ -21,9 +21,9 @@ extern void putchark(/* in */ char a);
|
||||
|
||||
extern result_code_e create_default_test_output(/* out*/ ptr_output_functions_s* output_location);
|
||||
|
||||
extern result_code_e run_unity_test(/* in */ const unity_test_function_ptr test_function, /* in */ const ptr_output_functions_s output);
|
||||
extern result_code_e run_unity_test(/* in */ const unity_test_function_ptr test_function, /* in */ const char* file_name, /* in */ const char* test_name, /* in */ int line_number, /* in */ const ptr_output_functions_s output);
|
||||
|
||||
extern result_code_e run_unity_printk_test(/* in */ const unity_test_function_ptr test_function);
|
||||
extern result_code_e run_unity_printk_test(/* in */ const unity_test_function_ptr test_function, /* in */ const char* file_name, /* in */ const char* test_name, /* in */ int line_number);
|
||||
|
||||
//}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
\
|
||||
result_code_e KUNITY_CREATE_TEST_NAME(function_name)(const ptr_output_functions_s output) \
|
||||
{ \
|
||||
return run_unity_test(function_name, output); \
|
||||
return run_unity_test(function_name, __FILE__, #function_name, __LINE__, output); \
|
||||
} \
|
||||
EXPORT_SYMBOL(KUNITY_CREATE_TEST_NAME(function_name)); \
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user