mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 07:50:43 +03:00
[test] Include failing code within failed test result output
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -45,8 +45,10 @@ static struct self_test *current_tests;
|
||||
* @v success Test succeeded
|
||||
* @v file Test code file
|
||||
* @v line Test code line
|
||||
* @v test Test code
|
||||
*/
|
||||
void test_ok ( int success, const char *file, unsigned int line ) {
|
||||
void test_ok ( int success, const char *file, unsigned int line,
|
||||
const char *test ) {
|
||||
|
||||
/* Sanity check */
|
||||
assert ( current_tests != NULL );
|
||||
@@ -57,8 +59,8 @@ void test_ok ( int success, const char *file, unsigned int line ) {
|
||||
/* Report failure if applicable */
|
||||
if ( ! success ) {
|
||||
current_tests->failures++;
|
||||
printf ( "FAILURE: \"%s\" test failed at %s line %d\n",
|
||||
current_tests->name, file, line );
|
||||
printf ( "FAILURE: \"%s\" test failed at %s line %d: ( %s )\n",
|
||||
current_tests->name, file, line, test );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user