summaryrefslogtreecommitdiffstats
path: root/src/tests/test.c
diff options
context:
space:
mode:
authorMichael Brown2013-11-27 04:03:16 +0100
committerMichael Brown2013-11-27 12:27:45 +0100
commit1312c467ee6b3e158b1babb13735114dce8c3690 (patch)
tree8b90d8228adcc0c4150be02c9b309d8de9812337 /src/tests/test.c
parent[dhcpv6] Allow stateful DHCPv6 to apply obtained IPv6 addresses (diff)
downloadipxe-1312c467ee6b3e158b1babb13735114dce8c3690.tar.gz
ipxe-1312c467ee6b3e158b1babb13735114dce8c3690.tar.xz
ipxe-1312c467ee6b3e158b1babb13735114dce8c3690.zip
[test] Include failing code within failed test result output
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests/test.c')
-rw-r--r--src/tests/test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tests/test.c b/src/tests/test.c
index 62f7c97d..9b65e351 100644
--- a/src/tests/test.c
+++ b/src/tests/test.c
@@ -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 );
}
}